hexrec.records.merge_files#

hexrec.records.merge_files(input_files, output_file, input_types=None, output_type=None, split_args=None, split_kwargs=None, build_args=None, build_kwargs=None)[source]#

Merges record files.

Merges multiple record files where each file overwrites overlapping data of the previous files.

Warning

Only binary data is kept; metadata will be overwritten by the call to Record.build_standalone().

Parameters:
  • input_files (list of str) – A sequence of file paths to merge.

  • output_file (str) – Path of the output file. It can target an input file.

  • input_types (list of types) – Selects the record type for each of the sequences in data_records. None will guess from file extension.

  • output_type (type) – Selects the output record type. None will guess from file extension.

  • split_args (list) – Positional arguments for Record.split().

  • split_kwargs (dict) – Keyword arguments for Record.split().

  • build_args (list) – Positional arguments for Record.build_standalone().

  • build_kwargs (dict) – Keyword arguments for Record.build_standalone().

Example

>>> merge_files(['merge1.mot', 'merge2.hex'], 'merged.tek')