Thanks Anbu23
When I posted yesterday, I simplified my problem, thinking that I could follow your logic, and apply it to my actual problem.
In fact, it is line 5 position 32 before which the CR/LF is to be inserted.
The new line 6 will contain fixed text from position 1 to 31 inclusive, (X)
and position 32 to 34 from line 5 will be dropped down to the same positions on line 6.
I tried
sed "5 s/\(...\).\(.*\)/\1\\
X \2/" $file > tmp
but this still spilt after 3 characters.
I tried
sed "5 s/\(.............................\).\(.*\)/\1\\
X \2/" $file > tmp
but got a syntax error.
Hope you can further help.
Thanks