Hello,
I have numerous files with tons of information in them. Everything stays the same (format wise) each time the file is created. What I want to do is search for a specific word(s) and print the line directly above it into another file. The word(s) I'll be searching for will remain the same every time. The file will look something like this:
my name is earl (guy)
say: hello
good: bye
etc
no
my name is frank (crazy)
say: goodbye
hello:
etc
yes
What I want to do is print the first line above every section that has "say: hello" on one line into another file. And get rid of the (* after the line im printing. I don't have any issues finding the "say: hello". I'm having trouble printing the line above "say: hello". Anyone have any ideas as to how I can about printing the line above the keywords i'm looking for?
Thanks in advance,
-Hoffa