in reply to Append to beginning of line (multi line file)
I suggest you try:
1. Open file, read all lines, close file.
2. Open another filename, write each $count and the line itself to the new file in a loop.
3. Unlink the old file, rename the new one to the old.
You can use @files to get the number of lines also, instead of reading the file again.
C.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Append to beginning of line (multi line file)
by FireBird34 (Pilgrim) on Jan 23, 2003 at 23:26 UTC |