Hi, please help
I need to re-layout a file so the records are on one line.
If I have 4 records then sample input:
10/29/2007
line 1 data
line 2 data
line 3 data
line 4 data
This line is rest of line 1
This line is rest of line 2
This line is rest of line 3
This line is rest of line 4
I need to put it like this:
10/29/2007 line 1 data This is rest of line 1
10/29/2007 line 3 data This is rest of line 2
10/29/2007 line 3 data This is rest of line 3
10/29/2007 line 4 data This is rest of line 4
so far I have:
NR == 1 { myday = $1
next
}
/^line/ {
firstpart[NR] = $0
}
/^this/ {
???
I need to re-layout a file so the records are on one line.
If I have 4 records then sample input:
10/29/2007
line 1 data
line 2 data
line 3 data
line 4 data
This line is rest of line 1
This line is rest of line 2
This line is rest of line 3
This line is rest of line 4
I need to put it like this:
10/29/2007 line 1 data This is rest of line 1
10/29/2007 line 3 data This is rest of line 2
10/29/2007 line 3 data This is rest of line 3
10/29/2007 line 4 data This is rest of line 4
so far I have:
NR == 1 { myday = $1
next
}
/^line/ {
firstpart[NR] = $0
}
/^this/ {
???