I have a series of folders /temp/a /temp/b /temp/c
In folders a, b, and c, I have files
a1.txt……….a20.txt
b1.txt……….b40.txt &
c1.txt……….c60.txt
Each file has the same data format :-
Line 1 AAAAA aaaa
Line 2 BBB bbbbbb
Line 3 CCCC cccccc
Etc etc
I need to write a sed script which will go through all the files and reformat the data thus :-
Line 1 AAAAA aaaa
Line 2 BBB
Line 3 X bbbbbb
Line 4 CCCC cccccc
Etc etc
So I need to insert a CR/LF in line 2 position 4,
create a new Line 3 with a constant text (X) and the value of what was to the right of the previous Line 2 (bbbbbb)
and move the remaining lines one line down.
Can anyone help please ?
I don't know sed
In folders a, b, and c, I have files
a1.txt……….a20.txt
b1.txt……….b40.txt &
c1.txt……….c60.txt
Each file has the same data format :-
Line 1 AAAAA aaaa
Line 2 BBB bbbbbb
Line 3 CCCC cccccc
Etc etc
I need to write a sed script which will go through all the files and reformat the data thus :-
Line 1 AAAAA aaaa
Line 2 BBB
Line 3 X bbbbbb
Line 4 CCCC cccccc
Etc etc
So I need to insert a CR/LF in line 2 position 4,
create a new Line 3 with a constant text (X) and the value of what was to the right of the previous Line 2 (bbbbbb)
and move the remaining lines one line down.
Can anyone help please ?
I don't know sed