4

how to get to previous line of a file?

view full story
linux-howto

http://www.unix.com – The situation is following : I have a file from which I am reading record one by one. While reading I have to check if any line starts with the value "SE". If, it finds any value starts with "SE", then I have to check whether its preceding line starts with "NE" or not. If the preceding line starts with "NE", then I have to extract some data from the "NE" line using cut. Else, I have to to extract some data from the "SE" line using cut. Please help me to find a way to resolve this problem. Thanks in advance (HowTos)