Even if you solve your problem reading and writing the same file, I think there is a problem with your logic. You read the file line by line from the beginning and for every line read you append a line and then, if the line you read doesn't match your pattern, you append six more lines, none of which match your pattern. If you continue in this way, the loop will continue and the file will grow until you run out of disk space or hit a file size limit.
In reply to Re: question about open
by ig
in thread question about open
by vbynagari
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |