On 16/12/08 22:10, Vim Questions wrote:
> Hello
> I need to remove carriage return (Char 13) from a text. Was adviced to
> use Vim. (MS-Windows).
>
> But can not inderstand how to do it.
> I loaded the text, "select all" and put ":list" in the end. It shows all
> the hidden characters and does not allow to edit/remove them. They
> disapper whenever I move the mouth.
>
> Please help !
>
> All the best, L
You can either use the special-purpose dos2unix utility or do the following:
1. Load Vim (don't yet specify an editfile).
2. Read the file, accepting either CR+LF or LF alone (or any mixture of
them) as an end-of-line marker
:e ++ff=dos filename.txt
3. Write the file, outputting only LF (without CR) at the end of each line
:setlocal ff=unix
:w
4. (Optional, if you don't need Vim any longer)
:q
The above assumes Vim 7.2.040 or later. With earlier versions it's
possible but not as simple.
Also:
- To learn how to use Vim, run the Vim tutor.
- Next time, please use a more specific Subject line. See
http://www.catb.org/~esr/faqs/smart-questions.html about how to increase
the likelihood that your questions will be answered.
Best regards,
Tony.
--
Proverb: A nightingale that forgets the lyrics is a hummingbird.
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---