![]() |
Is there a way to delete a line from a file?
Is there a way to delete a line from a text file?
:
int posEndIdx; |
You write back the whole file without the lines you don't want (i.e. you don't write those lines).
|
oh yeah... is a good idea... thanks nnxion
|
Actually, you can delete a line from a file and only have to write the (original) file from the point of deletion onward. Editing a file in place when you might put more back than you took out is where the problem arises. Easier then to just work with a temp, as nnxion suggests.
|
I wonder if you could do that with a couple of system commands in linux? ie. cat and grep, only use the reverse of a grep.
|
You mean like... grep -v ?
;) |
lol, i was sitting on windows so i didn't bother to man page it. Good to know :).
|
| All times are GMT -5. The time now is 7:54 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC