in reply to Re^3: How to loop over two lines, alter a value in the current line and save it to the previous line?
in thread How to loop over two lines, alter a value in the current line and save it to the previous line?
So for example, if in the first 3 lines of the file my 3rd columns are 4, 6, 9. My loop will start on line 2, and say it will change 6 to 8. The next iteration will be on line 3, however when it accesses line 2 it uses the old value 6 when I need it to use the new value 8, and hence from the third line onwards my code gives me incorrect output. So I'm just looking for a way to save the changed value to the previous line for the next iteration of the loop.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: How to loop over two lines, alter a value in the current line and save it to the previous line?
by 1nickt (Canon) on Jan 07, 2016 at 14:07 UTC | |
by rjc33 (Sexton) on Jan 07, 2016 at 14:14 UTC | |
by rjc33 (Sexton) on Jan 07, 2016 at 14:19 UTC |