>> I have a csv file with the following content:
>> 
>> country X
>> aa
>> bb
>> cc
>> dd
>> country Y
>> ee
>> ff
>> 
>> which I would like to convert to 
>> 
>> X aa
>> X bb
>> X cc
>> X dd
>> Y ee
>> Y ff
>
>1) bring the "country ___" line down to each non-country line:
>
>   :v/^country /?country ?t-|s/country //|j
>
>
>2) delete the country lines that are now superfluous:
>
>   :g/^country /d

Thank you, Tim, for solution and explanation. This dioes exactly what I
need.

>Step #1 is a bit packed:
>
>   :v/          on every line that doesn't match
> [...]

Just to get me started on the more complex commands such as these:
where can I look up commands like :v and :g ?


-- 

Best Regards,
Tarlika Elisabeth Schmitz

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to