Friday, May 25, 2018

Re: VIM Advanced text string search HELP

Hi Matt,

On Fri, 25 May 2018 01:16:54 -0700 (PDT)
Matt Truslove <m81tlove@gmail.com> wrote:

> Good morning,
> I have a very important XML file which contains a lot of important metadata.
> Recently my old computer has become useless so i managed to backup all my
> data and export all my files.
>
> as part of the backup i exported the metadata via an XML feature. But not
> realising that the new location would be different for all the files once
> moved.
>

see http://perl-begin.org/uses/text-parsing/ and
http://perl-begin.org/uses/xml/ and equivalents for other languages. See
https://blog.codinghorror.com/parsing-html-the-cthulhu-way/ .


> the XML file has a tag for Location and i need this to change whilst
> retaining the file name.
>
> i was told VIM is perfect for this. so fired fired up my old linux box to
> give it a go but no avail.
>
> please see the below example
>
> <key>Location</key><string>file:///Volumes/OLDDRIVE/OTHERFOLDER/aaaaa/bbbbb/ccccc/ddddd/eeeee/20Berksonax.uue</string>
>
> i want to find and replace the text between the "file:///" and the last but
> one "/" (as the last slash will affect the XML </string>.) but retain the
> file name, extension and end tag </string>
>
> to end up with
>
>
> <key>Location</key><string>file:///NewVolume/NEW_SSD/NEWFOLDER2018/0Berksonax.uue</string>
>



--
-----------------------------------------------------------------
Shlomi Fish http://www.shlomifish.org/
http://youtu.be/xZLwtc9x4yA - Anime in Real Life!! (Parody)

What's the point of claiming your code is illegal?
I might anger a few, but I just wanna sue
http://www.shlomifish.org/humour/bits/Can-I-SCO-Now/

Please reply to list if it's a mailing list post - http://shlom.in/reply .

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

Post a Comment