Data name: ABC001
Data length: 1000
Detail info
Data Direction Start_time End_time Length
1 forward 10 100 90
1 forward 15 200 185
2 reverse 50 500 450
Data name: XFG110
Data length: 100
Detail info
Data Direction Start_time End_time Length
1 forward 50 100 50
2 reverse 50 90 40
Data name: ABC010
Data length: 200
Detail info
Data Direction Start_time End_time Length
1 forward 150 190 40
.
.
.
Based on individual Data name, I would like extract its Start_time and End_time detail and put it at the column 2 and 3, respectively.
Thanks for any suggestion or hit to archive this goal.
Thanks a lot, Tytalus.
Your awk code worked perfectly and very fast for my case
I just check it along all my long list of data.
I found out something like this happen if my input data is shown like this:
My input
Data name: LCM50
Data length: 100
Detail info
Data Direction Start_time End_time Length
1 reverse 10 20 10
2 reverse 50 90 40
Data name: BCD011
Data length: 1000
Detail info
Data Direction Start_time End_time Length
Data name: FGG010
Data length: 500
Detail info
Data Direction Start_time End_time Length
1 reverse 10 190 180
My desired output:
LCM50 10 20
LCM50 50 90
FGG010 10 190
Problem facing by the awk code given this output:
LCM50 10 20
LCM50 50 90
FGG010 10 190
Do you know how to archive the desired output by ignoring those data that got Data name, but don't have Start_time and End_time?
Thanks, Tytalus.
---------- Post updated at 05:18 AM ---------- Previous update was at 05:15 AM ----------
Hi, dennis.jacob.
I just try your code. It is worked nice as well.
Just it can't add a newline between two different Data name
Thanks for your any advice and suggestion.
---------- Post updated at 05:22 AM ---------- Previous update was at 05:18 AM ----------
Thanks a lot too, ghostdog74.
Your code can work as well.
Just it also unable to add a new line between two different Data name detail
From your opinion, is it ok to archive my target by running your code first , then take the output file and let it add new lane in between two different data name after then?
Thanks for advice.