Hi friends, I am reading records from an external file to process them, but before processing them i need to make all records (except the last four) of equal length meaning all records should be padded with spaces and made of length 99 characters and also no spaces to be added to the last four records. Entire data then moves to a string for processing. The records that are being read are not necessarily of the same length. Please advise.
Entire data then moves to a string for processing.
Cannot be "huge" then.
If a file would be huge, then one could have a buffer for TAIL_SIZE + 1 lines.
Start reading to buffer.
When buffer is full, pad the first line, pop it out, and read next line in.
When read fails, flush the buffer out.