Hi there,
I don't want to get into the details but I am a DJ and I have a 2000
song music collection collected over years. Now, I moved my music onto
a different hard drive and my music programs will not find the files
any longer. I have to reim****t the files and I need a script to find
values in one text do***ent and to replace them with values from a
second do***ent. If I cannot manage then years of my work will be
lost. The text files are in block like this:
<ENTRY ARTIST="Afro Celt Sound System"
AUDIO_ID="AfUAERERERERERERERIhEiESERERIiISIiIiIiIiIiIzMzMzNEREREQzRERENEMzNURURFMzRFRVVVZVREVUNERENERDRERENmQiJEMiKEMiR1QjR0MzSFM0V0IjaGVDd1VEd2VEh1RVd2dlmGdViHh2p2dX3t3LzLu77MzL7My77e7d/
+/t/+///t7uyXZYhVVpqIdWZXd77N3+y7u/
7f7fy6qsmGiLmHmbqXmaiHmcqHismXmrqYmqmqq5ZESGRFWZZEQyEQKKrbrLnKnLrbrKrare3tzdvMvdvdvczcvd3szt3dzc3c3bzM3c3c3M3N3d7d7M3MtmdSEREAAAAA"
TITLE="Saor/Free/News from Nowhere" TYPE="1">
<LOCATION DIR="/Users/kurtp/Music/iTunes/iTunes Music/Afro Celt
Sound System/Sound Magic, Vol. 1/" FILE="Saor_Free_News from
Nowhere.mp3" VOLUME="Disk"/>
<ALBUM TITLE="Sound Magic, Vol. 1" TRACK="1"/>
<INFO BITRATE="160000" FILESIZE="9836" GENRE="World"
IM****T_DATE="2007/3/2" LABEL="6 slowdonwn" LAST_PLAYED="2007/9/21"
PLAYCOUNT="5" PLAYTIME="501" RANKING="153" RELEASE_DATE="1996/1/1"/>
<TEMPO BPM="163.944778" BPM_QUALITY="26.466862"/>
<LOUDNESS PEAK_DB="-0.799558" PERCEIVED_DB=" 2.399466"/>
<EXTDATA/>
</ENTRY>
I have 2000 songs so each text do***ent will have 2000 such
paragraphs. So essentially the script has to search for values in
2000 of these paragraphs and it has to do it 2000 times so the script
will have to run through the second do***ent 40000000 times. It's okay
as long as it does not take several days. Here is how it should work:
1) find text <entry artist
2) copy the text on the same line and to the right of <entry artist
as text as value 1
3) find text: <album title
4) copy the text on the same line and to the right of <album title as
text as value 2
5)find text FILE=
6) copy the text on the same line and to the right of FILE= as text
as value 3
find the paragraph with the same values in do***ent 2 (that's the old
file which I cannot use anymore because the paths are incorrect. I
cannot edit the paths since iTunes has renamed some of the files too)
find value PLAYCOUNT=x(variable. whatever it says) in do***ent 2 (in
that paragraph)
go back to do***ent 1 and replace the value x with value x from
do***ent 2
do the same thing with the value LAST_PLAYED=
go to paragraph 2 of do***ent 2 (the next song) and repeat all over
Is this insane? Maybe there is a much easier way. As described, the
script needs so match songs and replace some information in the "song
paragraph" of do***ent 1 from do***ent 2.
I would love to get some feedback if this is doable and at what price.
Thank you very much. Karo