I have many files .txt which looks like:
file1.txt
header
1_fff_aaa 1_rrr_aaa 1_ggg_aaa ...
file2.txt
header
1_ttt_aaa 1_iii_aaa 1_lll_aaa ...
I would like to remove the header and split the string of the second line in multiple lines after the white space and take the pattern in between the _ character:
Output:
file1_v1.txt
fff
rrr
ggg
file2_v1.txt
ttt
iii
lll
I would like to utilise unix commands like sed
Something like that:
Program:
split.awkExecuted like that:
To execute it on many files:
UPDATE
You could also use
sed&tr: