I have a series of files that have header and detail rows in them. In order to associate the detail lines with the header lines I need to add an ID to them.
The sample file is attached (in raw EBCDIC) form.
The script will need to read the input file line by line. I will then output a new file with the ID Number inserted at the start of each line. The ID will be a 10 digit integer. I will need the ability to pass the starting ID number in the command line.
The command will look something like:
script <input file> <output file> <starting ID>
The ID number will increment by one every time the first four bytes of a line are hex: D7 F1 C1 40
This will be run from a linux CLI. It can be written in PHP, Perl, or C/C++