Hello all !
I want to reorganize ALL MY MP3 files , split on different hard drives , USB-sticks ( different file systems) to my common NAS drive.
Therefore my planned workflow was :
- Run Mp3tag and export all the relevant data ( Tags like title, artist, filename, path,... ) into a CSV file.
- Run a GAWK script to convert the relevant columns of this CSV file and create a WINDOWS BAT/CMD file COPYM.BAT, which consists only of a lot of XCOPY commands.
The lines look like this one :
xcopy /C /Y /F "C:\Users\norbe\iCloudDrive\Exchange\Cafe Anatolia \11-Şimdi Uzaklardasın.mp3" "c:\music\Pop\Ceyhun Çelik\Cafe Anatolia \11-Şimdi Uzaklardasın.mp3*"
xcopy /C /Y /F "C:\Users\norbe\Music\iTunes\iTunes Media\Music\Hélène Grimaud\Rachmaninov_ Piano Concerto No. 2, Etude\01 Concerto for Piano and Orchestra.m4a" "c:\music\Klassik\Rachmaninov- Piano Concerto No. 2- Etudes & Preludes\01-Concerto for Piano and Orchestra No. 2 In C Minor, Op. 18: I. Moderato.m4a*"
There were some problems and challenges, I could fix ( e.g.
- the trailing '*' character at the end of the dest. filename,
- the Suppression of the BOM character in the created CSV-file ...
Everything , works , if the xcopy filenames only contain standard 7-bit ASCII characters.
But I have many audio files with special ( international ) characters ( see the examples above : Şimdi, Hélène, ...) , so my idea was to use UTF-8 coding for the COPYM.BAT file.
But here the WINDOWS problems start - a WINDOWS command shell normally is configured/started with a country specific copepage, e.g. Codepage 850 (Europe).
In this codepage the xcopy fails : many filenames are not readable ( file not found, directory not found,.... ).
So my idea was to change the copepage to UTF-8 with :
C:> chcp 65001
( change the codepage to UFT-8 characters )
Here the files are found, but the COPYM.bat files crashes after some lines with very mystic messages, in a way, that the command parser seems to get confused with the different length of the 2 or 3-byte UTF-8 characters.
Any ideas how to get it run in WINDOWS ?
My next try will be to modify the COPYM.bat to COPYM.sh and to run it under LINUX with cp Syntax, but I am not very experienced with LINUX and SMB filesystem mapping etc.
So my preferred solution would be under WINDOWS.....
Thanks for any good ideas and help ....