I have a huge amount of XML files that I need to rename. They are .plist files.
Within each file are a few tags, like this:
<key>Name</key>
<string>Steve Allen</string>
<key>Place</key>
<string>London</string>
At the moment, all the files are named with long random numbers, like 659238592496052.record
but I need them to be names according to the Name in the files, like SteveAllen.record
(without any space).
How would I do this?
The fragment you've posted is not valid xml so let's pretend it looks like this
Using that fragment as input, this program will rename any number of files given as args If you saved the program as "myrename" then "myrename file1.xml file2.xml file3.xml" would alter the pathname of file1.xml file2.xml and file3.xml to whatever the first item
The tag being called "key" seems to work in a sightly magical way :/