rycher has asked for the wisdom of the Perl Monks concerning the following question:
I have a file that contains multiple, very similar lines. How would I read through the file and remove every line in a block, except the very last one?
Example:
Before --- "SimpsonH","Homer","Simpson","NULL","648","0","218 555","Nuclear Contr +ol","Nuclear Operator","SimpsonM" "SimpsonH","Homer","Simpson","NULL","647","0","218 555","Nuclear Contr +ol","Nuclear Operator","SimpsonM" "SimpsonH","Homer","Simpson","NULL","648","0","218 555","Nuclear Contr +ol","Nuclear Operator","BurnsM" "SimpsonB","Bart","Simpson","NULL","748","0","218 555","Springfield El +ementary","Student","SimpsonM" "SimpsonB","Bart","Simpson","NULL","748","0","218 555","Springfield El +ementary","Student","SimpsonH" "SimpsonB","Bart","Simpson","NULL","748","1","218 555","Springfield El +ementary","Student","SkinnerP" After -- "SimpsonH","Homer","Simpson","NULL","648","0","218 555","Nuclear Contr +ol","Nuclear Operator","SimpsonM" "SimpsonB","Bart","Simpson","NULL","748","1","218 555","Springfield El +ementary","Student","SkinnerP"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Removing multiple lines
by BrowserUk (Patriarch) on May 01, 2009 at 05:47 UTC | |
|
Re: Removing multiple lines
by mikeraz (Friar) on May 01, 2009 at 12:02 UTC | |
by rycher (Acolyte) on May 04, 2009 at 00:58 UTC | |
|
Re: Removing multiple lines
by codeacrobat (Chaplain) on May 01, 2009 at 06:33 UTC | |
by BrowserUk (Patriarch) on May 01, 2009 at 06:37 UTC |