1

I have a file with contents like this:

name^Agroup^Ahost
name^Agroup^Ahost    
name^Agroup^Ahost

and I need it to be like this:

name group host
name group host
name group host

Trying the following, but none working:

sed -i 's/\^A/ /g' thefile.file
sed -i 's/^A/ /g' thefile.file

Help?

  • 2
    Your first attempt looks fine to me. I suspect that you don't actually have those characters `^A` in the file but they're being rendered like that due to an encoding issue. – Tom Fenech Apr 01 '16 at 12:48

1 Answers1

1

Use tr instead:

tr '\001' ' ' < inputfile

In sed, ^ doesn't mean Ctrl, but beginning-of-line.

Roland Illig
  • 40,703
  • 10
  • 88
  • 121