Computing.Net > Forums > Unix > very urgent query as i am new here

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

very urgent query as i am new here

Reply to Message Icon

Name: sanyogg
Date: November 2, 2007 at 23:29:54 Pacific
OS: windos 2000
CPU/Ram: P4 and 512MB RAM
Product: HP
Comment:

i am having a text file named plantlog.j of v big size. file contains text format like


msg 1031 : Shuttle arrived

3: 1 65 3 4 3 0

msg 1211 : Shuttle sent

3: 2 4 1 3

So, i want to grep each and every msg of no 1031 with its next line text (3: 1 65 3 4 3 0)

please help me by providing any command or script to find it.


sanyog garg from reliance industries



Sponsored Link
Ads by Google

Response Number 1
Name: fpmurphy
Date: November 4, 2007 at 06:07:12 Pacific
Reply:

If you want both lines:

sed -n -e '/1031/ {p;n;p; } plantlog.j

If you just want the line after 1031

sed -n -e '/1031/ {n;p; } plantlog.j


0
Reply to Message Icon

Related Posts

See More


Encrypt/ username and pas... Max column count in AIX



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: very urgent query as i am new here

I need a help from you. i am new to shell scr www.computing.net/answers/unix/i-need-a-help-from-you-i-am-new-to-shell-scr/8514.html

help with script - I am new to Unix www.computing.net/answers/unix/help-with-script-i-am-new-to-unix/2638.html

gen. new string from a text file www.computing.net/answers/unix/gen-new-string-from-a-text-file/7931.html