I have a number of files that has variable length records in it. I need a program to read them and write them out as fixed length records
## Deliverables
This program needs to be written in C/C++ or perl and will need to run on a Debian 2.6 x64 machine. I have all of the compilers necessary.
The first 4 bytes of the record will tell the length of the record (first 4 bytes inclusive). The system that it came out of added a CRLF to the end of each record so those will need to be stripped. **Note - there are legitimate CRLF in the data that are not at the end of the record. They need to be retained.
All records need to be written out with right padding of spaces to the number of bytes specified by an argument.
./yourprogram <input file> <output file> <fixed length>
The above needs to be the command with parameters. Attached is a small sample of the data. The following is a list of each record length.
1300
808
131
340
340
340
340
340
340
340
340
340
1300
808
131
340
340
340
340
340
340
340
340
340