I have a big file on Unix Sun Solaris machine where the data is as shown below.
LE8S
line 1
line 2
line 3
LE8E
GE8S
line 1
line 2
line 3
GE8E
LE8S
line 1
line 2
line 3
LE8E
I need to split the above file into two files, one file with all the lines between LE8S and LE8E and another with all the lines between GE8S and GE8E.
There can be any number of LE and GE lines. I need to combine all the lines between into two files.
Thanks for your reply and your code really helps to split the file.
Sir, My requirement is slightly changed now..
Please see if you can help.
Now I have lines in the file as below. Instead of LE and GE, file is now having
NS and NE. Where "N" indicates a number and if it is greater than or equal to 8, I need to pull the lines between into a file and N less than 8 then a seperate file.
Hope I clear about the requirement.
2S
line 1
line 2
line 3
2E
3S
line 1
line 2
line 3
3E
8S
line 1
line 2
line 3
8E
1S
line 1
line 2
1E
10S
line 1
line 2
line 3
10E