INIFile.vbs
INIFile.vbs copied to clipboard
Cannot differentiate betwen Sections wi5th the same name
Thanks for writing this code and putting us in a good direction for managing INI files in VBS. I was attempting to implement the code to read the output of ffprobe.exe to read the data from the different streams:
ffprobe.exe -i filename -show_streams > streaminfo.ini
So after reading the INI file there are 3 streams, 1 video and 2 audio (english and spanish). ffprobe outputs the streams as such:
[STREAM]
index=0
codec_name=h264
profile=Main
codec_type=video
[/STREAM]
[STREAM]
index=1
codec_name=mp3
profile=english
codec_type=audio
[/STREAM]
[STREAM]
index=2
codec_name=aac
profile=spanish
codec_type=audio
[/STREAM]
I want to be able to read each stream profile separately but calling INI.GetValue(Section,Key) will always return the first stream. I hope to be modifying the code so that I can GetValueBySectionIndex where rther than providing a section name (where the section name may be repeated), you can interate the sections by index. If you have an easier solution, please and thank you.