On Jul 28, 6:10 am, John Little <[email protected]> wrote:
> On Jul 28, 10:19 am, drlatex <[email protected]> wrote:

> > I have a gigantic file (millions of lines long), and I want
> > to make it all one line.  There is ONE \n at the end of
> > every line.

> IMO vim is line oriented, and unwieldy with megabytes all in
> one line.  I can imagine one wanting to do it after working on
> the file in vim, but in that case using a tool outside vim
> could work well:

> tr -d '\n' <x >y
> tr '\n' ' ' <x >z

Note that both of these will leave the file without any '\n' at
all, not even one at the end.  To get the one at the end, the
easiest solution is probably to reinsert it:
    ( tr -d '\n' <x ; echo ) >y

--
James Kanze (GABI Software)             email:[email protected]
Conseils en informatique orientée objet/
                   Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to