02-17-2014, 10:27 AM
Macro Macro2239
;out
int i
str in_settingsfile_content
str extracted_section_content ;; The string that changes (this will be put in the ICsv)
ARRAY(str) in_extracted_sections="path[]file_locations"
in_settingsfile_content=
;[path]
;c:\test
;;
;[file_locations]
;1a*E:\__qm_testdirs\test_ini_1.txt
;2a*E:\__qm_testdirs\test_ini_2.txt
ICsv v._create; v.Separator="|"
str output_string
for i 0 in_extracted_sections.len
,if(findrx(in_settingsfile_content F"(?s)^\Q[{in_extracted_sections[i]}]\E(.+?)(?:^\[|\z)" 0 8 extracted_section_content 1)<0)
,,extracted_section_content="ERROR"
,extracted_section_content.trim
,v.AddRow2(i in_extracted_sections[i] extracted_section_content)
v.ToString(output_string)
out output_string