Re: [OT] sed question

2004-03-15 Thread Dan Rue
On Sun, Mar 14, 2004 at 04:30:40PM -0600, Steven N. Fettig wrote: 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

Re: [OT] sed question

2004-03-15 Thread Parv
in message [EMAIL PROTECTED], wrote Warren Block thusly... ...sed on other systems does handle \n and other literals in substitutions. It's annoying enough that I just use Perl instead. perl -pe 's/ /\n/g' my_test_text_document.txt which actually would be better as perl -pe

Re: [OT] sed question

2004-03-15 Thread Warren Block
On Mon, 15 Mar 2004, Parv wrote: in message [EMAIL PROTECTED], wrote Warren Block thusly... perl -pe 's/\s./\n/g' my_test_text_document.txt ^ ^ Why do you have '.' after '\s'? Did you mean '+' instead? Oops--you're correct. \s+ for one or more

[OT] sed question

2004-03-14 Thread Steven N. Fettig
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

Re: [OT] sed question

2004-03-14 Thread Matthew Seaman
On Sun, Mar 14, 2004 at 04:30:40PM -0600, Steven N. Fettig wrote: 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

Re: [OT] sed question

2004-03-14 Thread Warren Block
On Sun, 14 Mar 2004, Steven N. Fettig wrote: 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 From the sed man page: 2. The escape sequence \n matches a newline character embedded

Re: [OT] sed question

2004-03-14 Thread Bill Campbell
On Sun, Mar 14, 2004, Warren Block wrote: On Sun, 14 Mar 2004, Steven N. Fettig wrote: 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 From the sed man page: 2. The escape sequence

Re: [OT] sed question

2004-03-14 Thread Warren Block
On Sun, 14 Mar 2004, Rob Ellis wrote: This works with sed in /bin/sh and ksh: sed -e 's/ */\ /g' my_test_text_document.txt I.e., escape an actual newline. I used to do that, or include an actual newline in a script, but it just seems wrong from maintainability and readability standpoints.