Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 Mar 2004 16:30:40 -0600
From:      "Steven N. Fettig" <freebsd@stevenfettig.com>
To:        freebsd-questions@freebsd.org
Subject:   [OT] sed question
Message-ID:  <4054DD10.5060504@stevenfettig.com>

next in thread | raw e-mail | index | archive | help
Sorry for posting an off-topic question to the list, but this is 
somethin that has been driving me nuts for weeks now and I can't figure 
it out.  I want to pass a text file through sed that replaces all 
whitespaces with a carriage return.  I.e., if I have the file 
my_test_text_document.txt that is a few paragraphs of writing, I want to 
take the following input:

I have just written five paragraphs of absolute jibberish and wish that 
I could get sed to work the way that I want.  Oh how this question has 
plagued me!

And have sed output:
I
have
just
written
five
paragraphs
of
absolute
jibberish
and
... you get the point.

I can't figure out what the newline character is... I've tried \n \r &\, 
etc. with no avail.  I run the following:

sed 's/[ ]/\n/g' my_test_text_document.txt

and the output never has a newline added regardless of what I have 
substituted \n with.  I have also used " instead of ' and that hasn't 
helped...
Sorry for the question, but I'd really appreciate the help!

Steve Fettig




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4054DD10.5060504>