http://qs321.pair.com?node_id=890866


in reply to Re^6: incrementing already existing file
in thread incrementing already existing file

With your program Newfile is replaced by B set of values. How do I make it to take A set first and go to B set.
So what you have is two collections of numbers in the file you open as MYFILE. One set is labeled 'A' in column 3 and the other is labeled 'B' in column 3. The values in column 5 are an index, and the values in the last column are the ones you need to collect and add to NEWF.

What I said before is still mostly what you need to do. Here's a revised outline of the code you need to write:

You didn't show a sample of what the output should look like, so this is as far as I can go with what you've posted. If the output should have both 'A' and 'B' values at the end of a line, you do one thing. If you need two lines (one for each of the 'A' and 'B' values), you do something different. But we can't know unless you tell us. Which leads me to the following advice about how to get along well on PerlMonks:

I think you have enough additional information now to "fix" my code to do what you want. Give it a shot and come back with questions if you run into trouble.