I have a file like this:
ident1 0ZZZ name1
ident1 1635 miscellaneous informations
ident1 1635 miscellaneous informations
ident1 9ZZZ
ident2 0ZZZ name2
ident2 1635 miscellaneous informations
ident2 1635 miscellaneous informations
ident2 1635 miscellaneous informations
ident2 9ZZZ
...
Each block consists of several lines identified with a code identifier on the first 7 characters, and each block begins
with a line ident1 0ZZZ name1 and ends with a line ident1 9ZZZ.
What I want? Just add after the code 1635 (always the same) namek value given in the first line of each block (name1, name2 ,...).
This should be possible with awk I suppose ... but how? I await your help, thank you ...
ident1 0ZZZ name1
ident1 1635 miscellaneous informations
ident1 1635 miscellaneous informations
ident1 9ZZZ
ident2 0ZZZ name2
ident2 1635 miscellaneous informations
ident2 1635 miscellaneous informations
ident2 1635 miscellaneous informations
ident2 9ZZZ
...
Each block consists of several lines identified with a code identifier on the first 7 characters, and each block begins
with a line ident1 0ZZZ name1 and ends with a line ident1 9ZZZ.
What I want? Just add after the code 1635 (always the same) namek value given in the first line of each block (name1, name2 ,...).
This should be possible with awk I suppose ... but how? I await your help, thank you ...