![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| manipulate data with specific format | tonet | Shell Programming and Scripting | 5 | 04-25-2008 08:24 AM |
| extract and format information from a file | sujoy101 | Shell Programming and Scripting | 12 | 04-16-2008 03:58 AM |
| Anyways to find sentences with data format and extract it??? | cyberray | Shell Programming and Scripting | 4 | 10-30-2007 08:22 PM |
| extract some specific text file urgent pls | reyazan | UNIX for Dummies Questions & Answers | 2 | 10-20-2005 06:36 AM |
| extract specific lines from file | apalex | UNIX for Dummies Questions & Answers | 2 | 05-15-2001 06:57 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#8
|
|||
|
|||
|
Thanks to this thread, awk: need to extract a line before a pattern I finally managed to extract out the data that I wanted.
Code:
awk '$0~/Start Time/{lineno=NR; text=$0} NR==lineno+6 && $0~/send messages/{print text}' filename
Using matrixmadhan's code : Code:
sed -n '/Start Time/s/^.*CDATA\[\(.*\)]].*$/\1/p' filename Thanks! |
|||
| Google The UNIX and Linux Forums |
| Forum Sponsor | ||
|
|