Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Setting ICsv object using a temporary 2 dim Array
#3
Macro Macro2239
Code:
Copy      Help
;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


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)