foreach %i in *.mp3No luck. This matches what I can find on line. So I ran bash in cygwin:
echo %i
MediaInfo %i } grep "Bit rate mode"
endfor
for i in (ls *.mp3)"i was unexpected at this time." I was at least expecting the file names, from the echo command.
do
echo $i
MediaInfo.exe $1 |grep "Bit rate mode"
done
MediaInfo works fine, file by file or with *.mp3. At least in CLI mode. I could not figure out how to display the needed data in GUI mode.
Found an easier way that does not require my apparently lost scripting skill:
MediaInfo.exe *.mp3 |grep "Bit rate mode\|Complete name"This gives file name and bit rate mode on subsequent lines.
I then used Lame to do the VBR to CBR conversion, and it produces only static. So now I am restoring from my backup and I will just use MediaInfo to find which are VBR and do the conversion with Audacity. Very slow but it works.
The bash script for identifying VBR files:
for file in $(ls *.mp3 */*.mp3); do count=`C:/MediaInfo.exe $file | grep "Bit rate mode" | grep "Variable" | wc -l`; if [ $count -gt 0 ]; then echo $file VBR; fi doneThere is probably a more elegant solution using find, but I have other things to do. Problem : $ls produces a series of words separated by blanks because many of the directory names have blanks. How do I force it not to do that? IFS=$'\n'