I have some code which will return some text (version number) but unfortunately there is more than one instance of “Version=” in the text file. How can I get the first instance only?
My current code which returns multiple results:
following texts of firsts “Version=” of lines whose (it starts with “Version=”) of file “C:\blah.ini” as string
following text of first "Version=" of preceding text of first ";:;" of concatenation ";:;" of lines whose (it starts with "Version=") of file "C:\blah.ini"
We actually have dedicated inspectors for parsing INI files. I’m guessing there is only one ‘version’ key for each ‘section’ (where a section is denoted by a header with the format:
sectionname
). If so, you’ll find the following much more efficient and also easier to read:
key “version” of section “section name” of file “c:\blah.ini”