Computing.Net > Forums > Unix > Pattern search help

Pattern search help

Reply to Message Icon

Original Message
Name: nish_r
Date: September 28, 2005 at 17:27:48 Pacific
Subject: Pattern search help
OS: HP UX
CPU/Ram: 512
Comment:

Hi,

I have a huge text file with following texts. This repeats with time stamp and current data.
---------

XY 123 KANDY_BSC 2005-09-29 10:05:59
##############################################
NUM-111 TEST U WO 1 BC004 WO
03911 67890 UVW-099 U WO 0 6
MYBTS2 BB
------------
I need to extract the date, time , field before UVW (67890 in this capture)and figure after third WO (0 6 here) and arrange them in a single line (tab delimited) and send to a seperate file.
Thanks in advance,

K


Dear All,
My network config. as follows.
m/c A - 192.168.100.100 (eri0)
m/c B - 192.168.100.200 (eri0)
172.16.80.5 (eri1)
m/c C - 172.16.80.150

m/c A & m/c B in one LAN. Also


Report Offensive Message For Removal


Response Number 1
Name: nish_r
Date: September 28, 2005 at 21:38:39 Pacific
Reply: (edit)

Sorry, pls ignore the footer attached.


XY 123 KANDY_BSC 2005-09-29 10:05:59
##############################################
NUM-111 TEST U WO 1 BC004 WO
03911 67890 UVW-099 U WO 0 6
MYBTS2 BB

XY 123 KANDY_BSC 2005-09-29 10:06:01
##############################################
NUM-111 TEST U WO 1 BC004 WO
03911 67823 UVW-099 U WO 1 5
MYBTS2 BB

Dear All,
My network config. as follows.
m/c A - 192.168.100.100 (eri0)
m/c B - 192.168.100.200 (eri0)
172.16.80.5 (eri1)
m/c C - 172.16.80.150

m/c A & m/c B in one LAN. Also


Report Offensive Follow Up For Removal

Response Number 2
Name: vicchai
Date: September 30, 2005 at 19:33:38 Pacific
Reply: (edit)

You can try this:

grep UVW < textfile.txt | awk '{print $2"\t"$6,$7}'


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Pattern search help

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software




Have you ever used OpenOffice?

Yes, as my main suite.
Yes, occationally.
Yes, but only once.
No, never.


View Results

Poll Finishes In 4 Days.
Discuss in The Lounge