Monday, March 7, 2011

Re: How to process 1000 files xml to 1 file?

a) this kind of stuff can easily be done using xml processing tools (eg
ruby, python, ...)
using XMLPath and the like

b) There is a basic XML parsing library available in
VimL git://github.com/mattn/webapi-vim.git
However it may not be the fastest way.

c) do what that library does manually: find start and and try to collect
values.
If all contain all tags you can use :v/lbpa_Nom\|lbpa_Pre\|lbpa_Nai/d
then use a :%s/ .. command with capturing to keep only values.
then you have

Nom
Pre
Mai

Then you can use macros or such to format 3 lines the way you want.
Alternative: getlines() and mod.

You can also use macros and two windows moving 10 lines down, picking
teh words, switching window, paste, .. continue.

If you want speed either use a) or c)

Marc Weber

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

No comments: