My objective is to replace the 8th, 9th, 10th characters by 1 space per character (total 3 spaces) in a file.
I achieved this using following command:
sed 's/\(.\)/\1@/7;s/@\(...\)/ /' FileData.txt > FileData_UPDATED.txt
Another situation comes when I need to done same but excluding 1st and last lines.
I tried using following but it removed the first and last line in the output:
sed '1d;$d' FileData.txt | sed 's/\(.\)/\1@/7;s/@\(...\)/ /' > FileData_UPDATED.txt
Please suggest how the first command can be updated to exclude the first and last lines.