Read and write to a file
Posted on 2007-09-28
I have a file I need to read and write to. The file is pound (#) delimited and it contains a list of filenames and 5 sets of numbers, ie
I need to do a few things:
Open this file and check is a previously set variable $input_file is any of the first field,
If true check is another previously set variable, $figure is equal to any of the 5 sets of numbers.
If true print out a statement $figure is equal to previous figure
If not true pop off the first figure and write the new number to the end of the line.
If the input file was Tom and the figure was 121,234, just a print out statement $figure is equal to previous figure
For example if the input file was John and the figure was $677,061, the new line for John would be