I checked out the Advanced Bash Guide
but I couldn't find what I need.
I need to get the first 2 digits of a string and store to a variable, and then I need the 4th and on to another. There's a function in VB.NET (I know, super lame, I took a class in it tho) that does it and it's like Microsoft.VisualBasic.Left("String",3) and it returns "Srt" or something.
Here's my practical use: I'm trying to convert all of my iTunes AAC files to MP3s so I can use them in my car. So far, I've figured out how to convert all of the files to MP3...
for i in *.m4a; do faad -w "$i" | lame - "`basename "$i" '.m4a'`.mp3"; done
Problem is, I'd like to also create ID3 tags automatically. With the filename alone, I can get the track number and song title, because each file is like "03 Melissa.m4a". I can remove the .m4a by using $basename "$i" '.m4a'
but that still leaves the "03 " in front.
I ultimately want it to be for i in *.m4a; do faad -w "$i" | lame --tt "Track Title" --tn TrackNumber - "`basename "$i" '.m4a'`.mp3"; done
but I don't know what kind of text manipulation it would take to achieve this.
Any help would be MUCH appreciated!!!! Thanks!!!!