Quote:
sed 's/\(.\{21\}\)\(.*\)\(.\{6\}\)/\1ABCD\3/' infile
|
Thereby proving that one can write totally inscrutable commands using SED.......
3 groups in "\()\" for backreference....loosely translated as:
group1: 21 of any character
group2: any # of characters
group3: 6 of any character
Replace with: group1 + ABCD + group3
Note that this will be VERY dependent on the format of the original file.
Another method would be to replace the 2nd group of 4 capital letters:
Quote:
sed 's/[A-Z]\{4\}/ABCD/2'
|
Even this is dependent on the exact structure of the file entries