Use two greps -I'd like to get the first line after a line containing "pm EDT".
I've read the man pages for grep and googled but to no avail.
I'm using Xcode4 with OS 10.7.4
Yeah that sounds way more efficient than a) opening the file yourself, b) using a language like awk to parse the file.Use two greps -
grep -A1 'pm EDT' whateverfile
That will get you the line you're looking for, AND the line after
Then, use another grep to find lines that don't match 'pm EDT'
grep -v 'pm EDT'
Stick them all one one line with a pipe:
grep -A1 'pm EDT' whateverfile | grep -v 'pm EDT'