I'm having a problem with a sed script.
A programmer needs to change columns 942,943,944 to blank spaces only where it has the number 999 in every line.
I didn't have a copy of the data file to test with originally so made my own up with a bunch of x's and put 999 in columns 5-7. The sed worked.
Today, I got a copy of the real data file, changed the �4' to �941' to reflect the actual starting column and the script fails with :
---
# ./sed_test
#!/bin/ksh -xv
#
sed -e 's/^\(.\{940\}\)999/\1 /' /admin/bin/test/PGINPEN > /admin/bin/test/sed.test.data.out
+ sed -e s/^\(.\{940\}\)999/\1 / /admin/bin/test/PGINPEN
+ 1> /admin/bin/test/sed.test.data.out
sed: 0602-404 Function s/^\(.\{941\}\)999/\1 / cannot be parsed.
___
It doesn't like the starting column for some reason.
Here are the 2 scripts I used.
sed -e 's/^\(.\{4\}\)999/\1 /' /admin/bin/test/sed.test.data2 > /admin/bin/test/sed.test.data.out
sed -e 's/^\(.\{941\}\)999/\1 /' /test.input.file > /test.output.file
Any ideas?