|
|
|
good chemistry is complicated, and a little bit messy -LW |
|
| PerlMonks |
deleting first line of a file using in-place editingby ranjan_jajodia (Monk) |
| on Sep 08, 2005 at 02:27 UTC ( [id://490110]=perlquestion: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.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
|
|
||||||||||||||||||||||||||||||||||||