okay, time to ask the wizards.
Gary Kline
kline at thought.org
Thu Oct 28 06:30:57 UTC 2010
On Wed, Oct 27, 2010 at 07:10:55PM -0600, Chad Perrin wrote:
> On Wed, Oct 27, 2010 at 06:04:50PM -0700, Gary Kline wrote:
> > I've got a very large file with paragraphs separated only by "\n".
> > How do I put a blank line _after_ each newline?
>
> perl -e 'while (<>) { s/$/\n/; print; }'
>
> You could also open the file in vi or Vim and give it this command:
>
> :%s/$/^M/
>
> Note that you don't type in that ^M by using the ^ and M keys on the
> keyboard. Instead, you first type ctrl-v then press the Enter key.
>
Thanks, much.... I've been editing the entire day [[ well, before
I stopped to watch the ST DVD:-)]]. Then trying to remember how the
hell to get a newline into a vi :sub. There is a way using tr that
is among the tr man page examples. Not sure that will work.
I'll put your perl exaple with -pi.bak into my ~/bin directory.
That way, when my brain stalls I'll have it.
gary
PS: There are a few remaining regex tricks that I have to catch
before I run the file thru atom. For now: calling "T"--
> --
> Chad Perrin [ original content licensed OWL: http://owl.apotheon.org ]
--
Gary Kline kline at thought.org http://www.thought.org Public Service Unix
The 7.90a release of Jottings: http://jottings.thought.org/index.php
http://journey.thought.org
More information about the freebsd-questions
mailing list