- #1
Sam032789
- 11
- 0
Hello! I have a file that looks like this:
Where every line beginning with a T is a new data set. So basically I need each line in the file to look like this:
I need to merge every other line so that each data set lies on the same line. There can just be a space in between the two data points, a comma is not necessary.
So what's the easiest way to go about doing this? I was thinking something along the lines of sed, awk, or grep. Help is greatly appreciated.
T,2009,05,06,15,54,34
D,NBXX,500,1.032e-4,7.657e-5,4.956e-5,9.404e-6,7.269e-6,6.667e-6
T,2009,05,06,15,55,34
D,NBXX,440,1.032e-4,7.665e-5,4.911e-5,9.303e-6,7.292e-6,6.507e-6
T,2009,05,06,15,56,34
D,NBXX,380,1.041e-4,7.743e-5,5.073e-5,9.635e-6,7.639e-6,6.867e-6
T,2009,05,06,15,57,34
D,NBXX,320,1.027e-4,7.628e-5,4.938e-5,9.491e-6,7.596e-6,6.489e-6
T,2009,05,06,15,58,34
D,NBXX,260,1.014e-4,7.490e-5,4.852e-5,9.352e-6,7.325e-6,6.657e-6
T,2009,05,06,15,59,34
D,NBXX,200,1.010e-4,7.408e-5,4.763e-5,9.408e-6,7.383e-6,6.794e-6
.
.
.
(etc.)
Where every line beginning with a T is a new data set. So basically I need each line in the file to look like this:
T,2009,05,06,15,59,34 D,NBXX,200,1.010e-4,7.408e-5,4.763e-5,9.408e-6,7.383e-6,6.794e-6
I need to merge every other line so that each data set lies on the same line. There can just be a space in between the two data points, a comma is not necessary.
So what's the easiest way to go about doing this? I was thinking something along the lines of sed, awk, or grep. Help is greatly appreciated.