Mailinglist Archive: opensuse (3637 mails)

< Previous Next >
[OT DEVEL] How to switch spaces (or anything) for a newline with sed?
  • From: wilson@xxxxxxxxxxx (Jonathan Wilson)
  • Date: Wed, 30 May 2001 11:24:00 -0500
  • Message-id: <>

I've got a file that I need to convert all spaces to newlines. According to the O'Rililey Regular Expressions book, it looks like \n is the correct charachter, but sed -e 's.\ .\n.g puts in a litteral \n instead of a carriage return.

Obviously I don't know what I'm doing. What's the proper way to put in things like \n, \r, and \t with sed?

I'd also be quite willing to use awk to do this.


Jonathan Wilson
System Administrator

Cedar Creek Software
Central Texas IT

< Previous Next >