![]() |
|
The stupid question is the question not asked | |
PerlMonks |
deleting first line of a file using in-place editingby ranjan_jajodia (Monk) |
on Sep 08, 2005 at 06:27 UTC ( #490110=perlquestion: print w/replies, xml ) | Need Help?? |
ranjan_jajodia has asked for the wisdom of the Perl Monks concerning the following question:
Dear Monks, I need to delete the first line of a file, i.e, if a file's content were: After editing it should become: I have tried the following command but it seems to delete all lines even though I did not put g(global) option: perl -p -i -e "s/[^\n]*\n//" test.txt Could any one tell me what is wrong over here and what is the correct way? Regards Ranjan
Back to
Seekers of Perl Wisdom
|
|