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: <5.1.0.14.0.20010530112104.03096ec8@xxxxxxxxxxxxxxxx>
Howdy,


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.

TIA

----------------------------------------------------
Jonathan Wilson
System Administrator

Cedar Creek Software http://www.cedarcreeksoftware.com
Central Texas IT http://www.centraltexasit.com


< Previous Next >