I wrote a script in bash. That script is making a file with extension .DAT File getting details from mp3 files. I used exiftool to take id3 tags. I have a mp3 file called Miley Cyrus - Wrecking Ball.mp3 this script making file Miley Cyrus - Wrecking Ball.DAT which contain some details form ID3 tags.
My script in bash.
#!/bin/bash
find . -name '*.mp3' -print0 | while read -d $'\0' file
do
ARTIST=$(exiftool -p '$Artist' "$file")
ALBUM=$(exiftool -p '$Album' "$file")
TITLE=$(exiftool -p '$Title' "$file")
touch "$file".DAT
echo "Lit=" >> "$file".DAT
echo "ENG=" >> "$file".DAT
echo "CRD=" >> "$file".DAT
echo "TIT=$TITLE" >> "$file".DAT
echo "ALB=$ALBUM" >> "$file".DAT
echo "ART=$ARTIST" >> "$file".DAT
done
I need that script but in windows, and here starts my troubles. I have no idea which way can I start with it. Which options I have to use for loop, why exiftool no getting tags from file? I tried to use fname to separate name and extension but with no results.
- What I need to do for start working in windows this scripts.
@echo off
setlocal enableDelayedExpansion
for %%a in (*.mp3) do (
set "Title=(exiftool -p Title '%%a')"
set "Album=(exiftool -p Album '%%a')"
set "Artist=(exiftool -p Artist '%%a')"
echo "Lit=" >> "%%a".DAT
echo "ENG=" >> "%%a".DAT
echo "CRD=" >> "%%a".DAT
echo "Title=%Title% >> "%%a".DAT
echo "Album=%Album% >> "%%a".DAT
echo "Artist=%Artist% >> "%%a".DAT
)
exiftool is in windows folder.