В общем, я пытаюсь получить рейтинг из mp3 программно, и с помощью инструмента командной строки id3v2 я могу получить рейтинг, в который моя программа помещает его:
$ id3v2 -R Drake\ -\ Over3.mp3
id3v1 tag info for Drake - Over3.mp3:
Title : Over Artist: Drake
Album : Thank Me Later Year: 2010, Genre: Unknown (255)
Comment: The highly anticipated debut Track: 0
id3v2 tag info for Drake - Over3.mp3:
TPE2 (Band/orchestra/accompaniment): Drake
TIT2 (Title/songname/content description): Over
TPE1 (Lead performer(s)/Soloist(s)): Drake
TALB (Album/Movie/Show title): Thank Me Later
TYER (Year): 2010
TCON (Content type): Rap - Hip-Hop (255)
TPUB (Publisher): Cash money/Universal Motown
POPM (Popularimeter): Windows Media Player 9 Series, counter=0 rating=196COMM (Comments): (MusicMatch_Preference)[eng]: Very Good
COMM (Comments): ()[eng]: The highly anticipated debut from Drake is here! "Thank Me Later" is hotest album in the game.
APIC (Attached picture): ()[, 3]: image/jpg, 38227 bytes
COMM (Comments): (ID3v1 Comment)[XXX]: The highly anticipated debut
TRCK (Track number/Position in set): PUB
Который я могу сузить до
$ id3v2 -R Drake\ -\ Over3.mp3 | grep POPM
POPM (Popularimeter): Windows Media Player 9 Series, counter=0 rating=196COMM (Comments): (MusicMatch_Preference)[eng]: Very Good
Проблема:
Я не уверен, как я могу получить 'rating = ### `из этой строки. Мой awk/sed-fu слаб :(