134523Re: New line not recognized
- Nov 16, 2012--On Fri, Nov 16, 2012 at 10:18 AM, Marco <netuse@...> wrote:
I received a text file with tab-separated values. However, the
entire file is displayed in one line and vim shows ^M symbols
all over the text, which are U+000d characters (CR).
I ran a search-replace to replace them with <CTRL-V><CR> and the
file displays as it should. But what's the cause? Is the file
malformed? I thought CR is the usual way of encoding a line ending.
What do I need to change to make vim display the file correctly
without changing it?
What system might have saved the file? Usually I never have any
problems opening files from Windows or Mac.
The file in question can be downloaded here:
http://freeshell.de/~mpfusion/1.txt (15 KiB)
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Nov 12 2012 19:41:47)
Included patches: 1-712
on Debian Linux
Different operating systems use different line endings for text files. From :help 'ff':
What OS are you opening the file in? Next time you open the offending file, try ":set ff?" (without the quotes) to see what it says. The <CR> way is "mac".
My Windows GVim opened the file exactly as you described: one long line. However, by using ":e ++ff=mac" (again, no quotes) I was able to reload the file correctly.
Hope this helps,
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
- << Previous post in topic Next post in topic >>