You are reading a single comment by @NotThamesWater and its replies.
Click here to read the full conversation.
-
You can probably do it in one line of bash!
for file in *.mp3; do [ "$(tag "$file")" == "TAG" ] && \ ( artist="$(tail -c 95 "$1" | head -c 30 | rtrim; "$file" | filt)"; \ album="$(tail -c 65 "$1" | head -c 30 | rtrim; "$file" | filt)"; \ title="$(tail -c 125 "$1" | head -c 30 | rtrim; "$file" | filt)"; \ track="$(tail -c 3 "$1" | hexdump -ve '/1 "%02i "' \ | awk '{ if ($1 == 0 && $2 != 0) print $2" " }' "$file" | filt)"; \ dir="$artist - $album"; \ newfile="$track$artist - $title.mp3"; \ mkdir -p "$dir"; \ mv "$file" "$dir/$newfile"); \ done
You can probably do it in one line of perl!