I have a rather large pipe delimmited file and I would like to break it down into sections simply by putting an empty line if the second filed is different from the second field in the previous line.
For example if the file is:
1|4847|test|393|somthing
2|4847|another|9|more
3|4847|fo|943|bar
4|4849|blah|93|blah
5|4850|last|384|line
6|4850|sorry|384|ILied
I would like to have a new file which reads:
1|4847|test|393|somthing
2|4847|another|9|more
3|4847|fo|943|bar
4|4849|blah|93|blah
5|4850|last|384|line
6|4850|sorry|384|ILied
Any suggestions you have is greatly appreciated.