Sed command

April 7, 2009 at 22:19:53
Specs: Windows XP
Hi, im trying to figure out, what sed command will add three blank spaces to the lines that do not start with a number. Something like this:

sed '/\!^[0-9]/ / s' data1

But its not working, it is not adding there blank spaces to the non-numbers lines
Thanks !


See More: Sed command

Report •


#1
April 7, 2009 at 22:53:28

sed '/^[^0-9]/s/$/ /g' myfile > mynewfile

Report •

#2
April 8, 2009 at 00:33:30
Thanks. It's not working. I am not getting any error message, but it doesn't insert any blank spaces to the lines that do not start with a number

I also tried the following commands:


sed '/^[^0-9]/s/ /g' data1
sed '/s^[^0-9]/ /g' data1
sed '/s/^[^0-9]/ /g' data1
sed '/s^/[^0-9]/ /g' data1
sed '/s^/[^0-9]/ /' data1

sed '/s/^[^0-9]/ /' data1
sed '/s/^\![0-9]/ /' data1
sed '/^[^0-9]/s/$/ /g' data1
sed '/^[0-9]/s/$/ / ' data1

I know I am close and it's probably just a matter of one or two characters !! Drives me nuts


Report •

#3
April 8, 2009 at 01:06:06
sed 's/^\([a-zA-Z].*\)/\1   /' file

Unix Win32 tools | Gawk for Windows


Report •

Related Solutions


Ask Question