Yes. It needs to be outside the loop because your loop's going through the input file line by line. Everything that's inside the loop is done for each individual line, so if you print to your output file inside the loop, you'll print to it for every single individual line of your input file.
Move the print statement out of the loop, and it'll only execute once, after the loop is done and the entire input file has been read and processed.
In reply to Re^3: Output from read/write txt file
by AppleFritter
in thread Output from read/write txt file
by Hayest
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |