Friday, March 15, 2019

Re: Keeping endofline representation in xml fileformat dos file

Am 14.03.2019 um 21:21 schrieb nivaemail@gmail.com:
> Hi All,
>
>
> I'm wokring on that kind of files'content, initially configured with ff=dos, ffs=unix,dos
>
> <?xml version="1.0" encoding="utf-8"?>
> <PROP ID="script" VALUE="&apos; Init properties
> Option Explicit
>
> Dim varName1, vaName2
> Dim nameOfBar
> &apos; array creation of components
> fnameOfBar = split(Parent.somefoobar, &quot;|&quot;)
> "/>
>
>
> 1/ Instead of the whole content up above, I see only one line with ^M in place of endline CR LF.
>
>
> 2/ Copying this inline containing ^M in new buffer opened with setlocal ffs=unix, I do this substitution %s/^M/^M/g
>
> Then I see all content in different lines.
>
>
> 3/ After editing the script, I would like to restitute the modified content into original file in one line : all content inline with end of line replaced by ^M. As at the origin.
>
> But all attempts fails, even these that say to pass by changing ffs at opening time and writing time.
>
> https://stackoverflow.com/questions/3852868/how-to-make-vim-show-m-and-substitute-it
> https://superuser.com/questions/357760/vi-on-linux-show-m-line-endings-for-dos-format-files
>
>
> Is someone can give me right way to restitute the text content inline containing ^M displayed.
>
> Thank you
> NiVa

Given a file.xml with mixed file endings.

You want to
(1) make it a DOS file:
:e ++ff=dos file.xml
" ... further edits ...
:w
(2) make it a Unix file:
:e ++ff=dos file.xml
:setl ff=unix
" ... further edits ...
:w
(3) keep mixed line endings:
:e file.xml
" ... further edits ...
:w

--
Andy

--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: