Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Remove line above matching criteria

by idsfa (Vicar)
on Nov 20, 2006 at 17:28 UTC ( #585095=note: print w/replies, xml ) Need Help??


in reply to Remove line above matching criteria

You haven't shown us what you have tried so far, nor what your criteria for "best" are (fastest, least memory, simplest, etc). We cannot easily help you if you don't do your homework first.

From what you've given us, I'd egrep -v the data from the command line and skip perl altogether ...


The intelligent reader will judge for himself. Without examining the facts fully and fairly, there is no way of knowing whether vox populi is really vox dei, or merely vox asinorum. — Cyrus H. Gordon

Replies are listed 'Best First'.
Re^2: Remove line above matching criteria
by kwaping (Priest) on Nov 20, 2006 at 17:48 UTC
    If you're going to go that route, you can also (with GNU grep, at least) grep -B 1 '<id:>' to get the ID line together with the previous line.

    ---
    It's all fine and dandy until someone has to look at the code.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://585095]
help
Chatterbox?
[marto]: which part don't you know how to do?
[marto]: oh
[Corion]: arunks: Maybe How do I make password prompts not echo back the user?? Or simply read it from STDIN.
[Corion]: arunks: Please do not ask us to write your program. You have to write your program yourself.

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (11)
As of 2017-01-20 14:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (174 votes). Check out past polls.