I have downloaded a file from Unix and try to edit it in windows with
vim. However, the new line charachers for unix is not the same as
that of windows.
In windows vim, i see the character <0d>. How to remove it with one
command in vim?
I have tried to search the character with /^V13 and /^x0d but fails.
Thanks in advance for any ideas and inputs.
Wing
I think 0d is 13 which is \r. But it sounds like you might have a
macintosh file; unix uses only 0a (10 or \n).
Mike
>Hi,
>
>I have downloaded a file from Unix and try to edit it in windows with
>vim. However, the new line charachers for unix is not the same as
>that of windows.
Yes, but vim can change that. If you edit a Unix file (LF only) and you
want to change it to a Windows file (CR-LF), use
:set fileformat=dos
>In windows vim, i see the character <0d>. How to remove it with one
>command in vim?
To remove all extra carriage returns:
:%s/^V^M//g
(That's ctrl-V ctrl-M).
In vim 6.x with the Windows cut-and-paste keys turned on, use Ctrl-Q
instead of Ctrl-V.
--
- Tim Roberts, ti...@probo.com
Providenza & Boekelheide, Inc.
>
> In windows vim, i see the character <0d>. How to remove it with one
> command in vim?
The Vim Way
:%s/\r//g
--
zzapper
vim -c ":%s/^/WhfgTNabgureRIvzSUnpxre/|:%s/[R-T]/ /Ig|:normal ggVGg?"
http://www.vim.org/tip_view.php?tip_id=305 Best of Vim Tips