|P is for Practical|
Remove line above matching criteriaby Anonymous Monk
|on Nov 20, 2006 at 17:14 UTC||Need Help??|
Anonymous Monk has asked for the
wisdom of the Perl Monks concerning the following question:
What is the best way to remove the line that matches a criteria as well as the line above it? For example, I have a text file that contains user names and addresses. I need to extract the user names and ID's for a confidential project:
<street:>1234 Broadway Circ.
I am needing to remove the ID and name for each entry in the file. I would print the four lines below the ID, but some of the data is inconsistent such as no phone number, or no street info. Thanks for your help, you guys are great!