thunderkid
Technical User
I need to create new file as follows:
Input:
34567645
abc 0:01:41.0 2345 rt45
abc 0:01:42.0 2345 rt45
abc 0:02:03.0 2345 rt45
abc 0:03:04.0 2345 rt45
56753434
def 0:03:05.0 erte wfe5
def 0:03:06.0 erte wfe5
def 0:04:07.4 erte wfe5
def 0:05:08.5 erte wfe5
Desired output:
34567645 abc 0:01:41.0 2345 rt45
34567645 abc 0:01:42.0 2345 rt45
34567645 abc 0:02:03.0 2345 rt45
34567645 abc 0:03:04.0 2345 rt45
56753434 def 0:03:05.0 erte wfe5
56753434 def 0:03:06.0 erte wfe5
56753434 def 0:04:07.4 erte wfe5
56753434 def 0:05:08.5 erte wfe5
The following script was suggested for similar task, but I have not been able to modify it to work for task above. I have tried several variations on the scripts, but have not been able to get to the desired output I need.
awk '
/Seed /{Seed=$NF;next}
{print Seed " " $0}
' /path/to/input >output
Need of help,
thunderkid
Input:
34567645
abc 0:01:41.0 2345 rt45
abc 0:01:42.0 2345 rt45
abc 0:02:03.0 2345 rt45
abc 0:03:04.0 2345 rt45
56753434
def 0:03:05.0 erte wfe5
def 0:03:06.0 erte wfe5
def 0:04:07.4 erte wfe5
def 0:05:08.5 erte wfe5
Desired output:
34567645 abc 0:01:41.0 2345 rt45
34567645 abc 0:01:42.0 2345 rt45
34567645 abc 0:02:03.0 2345 rt45
34567645 abc 0:03:04.0 2345 rt45
56753434 def 0:03:05.0 erte wfe5
56753434 def 0:03:06.0 erte wfe5
56753434 def 0:04:07.4 erte wfe5
56753434 def 0:05:08.5 erte wfe5
The following script was suggested for similar task, but I have not been able to modify it to work for task above. I have tried several variations on the scripts, but have not been able to get to the desired output I need.
awk '
/Seed /{Seed=$NF;next}
{print Seed " " $0}
' /path/to/input >output
Need of help,
thunderkid