Search text and pull lines that follow

September 30, 2010 at 16:19:30
Specs: Windows XP
I am very new to batch and I have been teaching myself off the well of info off this site. But this is a problem I cannot find a solution for:
I have large txt files generated from a program. Here is a sample of the txt with the lines I would like to pull marked with a (-->) but the (-->) is not in the txt file:

8 126 1 -1.32033
8 127 1 -1.32033
8 128 1 -1.32033
8 129 1 -1.32033
8 130 1 -1.32033
*** START OF RUN 2 IN OFFLINE MODE ***
Date = May/09/10 Time = 17:37
Num of Sequences = 1
MATRIX SIZE(s)
9 x 8
*** RUN SUMMARY ***
System Pause Duration (in seconds): 0
Number of Selections = 7
(-->) Expected Copy Spelling Characters: QUICKLY
(-->) Q U I C K L Y
Duke_006_S003_May0910_1732_summary.txt
Sun May 09 17:40:24 2010

These line groups are repeated several times (10 at least). Each time the line occurs the word in all caps changes (i.e. QUICKLY, will be replaced with the word DRIVING in the next section)
I would like to pull the word in all caps each time, I can't do this with line numbers because the number of lines can vary with each txt file.
Thanks so much!


See More: Search text and pull lines that follow

Report •

#1
September 30, 2010 at 17:05:30
download gawk for windows then do this


C:\test>gawk "/Expected/{print $NF;getline;print}" file
QUICKLY
(-->) Q U I C K L Y

don't know if i get you correct.

GNU win32 packages | Gawk


Report •
Related Solutions


Ask Question