This really is a dummy question but I'm stuck and out of time... I have a large file and out of it I only want to pick out lines starting with either "Pressure" or "N". I still need these lines to be in their original order.
example of text
Pressure 3
N 2
N 3
bla bla
bla bla
Pressure 4
bla bla
N 5
I would like
Pressure 3
N 2
N3
Pressure 4
N 5
I can use awk (see below) but can only get the coding correct to pick out one line at a time.
awk '/Pressure/, /[Pa]/' all > check.txt
awk '/ N /' all > check.txt
I need awk to scan a line at a time so that the Pressure lines and N lines are still printed in the correct order.
Any help appreciated,
Jenny