-1

Does anyone know of a way to only extract the id3 size information using exiftool. There is a robust documentation but I'm not seeing how to extract only the id3 info.

======== Test_file.mp3
ExifToolVersion                 : 10.78
FileName                        : First-time Bosses.mp3
Directory                       : .
FileSize                        : 33 MB
FileModifyDate                  : 2018:02:08 16:35:02-06:00
FileAccessDate                  : 2018:02:09 13:40:59-06:00
FileInodeChangeDate             : 2018:02:09 13:36:59-06:00
FilePermissions                 : rw-rw-r--
FileType                        : MP3
FileTypeExtension               : mp3
MIMEType                        : audio/mpeg
MPEGAudioVersion                : 1
AudioLayer                      : 3
AudioBitrate                    : 128 kbps
SampleRate                      : 44100
ChannelMode                     : Joint Stereo
MSStereo                        : Off
IntensityStereo                 : Off
CopyrightFlag                   : False
OriginalMedia                   : False
Emphasis                        : None
ID3Size                         : 222797
EncodedBy                       : iTunes 9.1
Title                           : Test_file
Artist                          : Test_file
Album                           : Test_file
Genre                           : Test_file
PictureFormat                   : PNG
PictureType                     : Other
PictureDescription              :
Picture                         : (Binary data 212414 bytes, use -b option 
 to extract)
Duration                        : 0:36:14 (approx)
  • What environment are you in? What have you tried? What format output are you looking for? – sorak Feb 09 '18 at 22:51

1 Answers1

0

I would use grep to find the line, and then awk to keep only the last word:

grep ID3Size Test_file.mp3 | awk 'NF>1{print $NF}'

If that was generated by some function foo, you wouldn't need to mention a source file:

foo | grep ID3Size | awk 'NF>1{print $NF}'

Jeffrey Benjamin Brown
  • 3,427
  • 2
  • 28
  • 40