Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SED & AWK find,delete,select,join query

Status
Not open for further replies.

marrow

Technical User
Jul 20, 2001
425
US
I want to find every line with...
"Receive Transaction" in "myfile"
then ignore this line and the next 11 lines
then select the next 2 lines....
'Rcv-0' 'ROUTER_x'
'Rcv-1' 'ROUTER_y'

join these 2 lines together to make....
'Rcv-0' 'ROUTER_x''Rcv-1' 'ROUTER_y'

Then repeat through the file
I could do this with many commands, any advice on quicker methods, would be appreiated
 
Thanks for the post Annihilannic, I did look at the thread, but in the end I didn't need a "join" so it was simpler with a one line "sed -n /search/ n,p....'s / grep / head command" which works fine but need s a little tuning


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top