<div dir="ltr">Hi,<div><br></div><div>I am trying to use readData() function in Swift to read fields into a Swift structure but seems it is reading the whole line as a single field. </div><div><br></div><div>Here is my text file for the data:</div>
<div><br></div><div><div>$ cat data.txt</div><div>Survey_data Strategy_data Field_data quadui_outdir</div><div>/home/kcm92/faceit-pipeline/FIXED_ACE_DOME/ACCESS1/4.5/MID/EMBU/Survey_data_import_fixed.zip /home/kcm92/faceit-pipeline/FIXED_ACE_DOME/ACCESS1/4.5/MID/EMBU/Seasonal_strategy_fixed.zip /home/kcm92/faceit-pipeline/FIXED_ACE_DOME/ACCESS1/4.5/MID/EMBU/Field_Overlay_fixed.zip /home/kcm92/outdir_1</div>
<div>/home/kcm92/faceit-pipeline/FIXED_ACE_DOME/ACCESS1/4.5/MID/ISHIARA/Survey_data_import_fixed.zip /home/kcm92/faceit-pipeline/FIXED_ACE_DOME/ACCESS1/4.5/MID/ISHIARA/Seasonal_strategy_fixed.zip /home/kcm92/faceit-pipeline/FIXED_ACE_DOME/ACCESS1/4.5/MID/ISHIARA/Field_Overlay_fixed.zip /home/kcm92/outdir_2</div>
</div><div><br></div><div>I have 4 fields and 2 rows.</div><div><br></div><div>Here is the structure definition:</div><div><br></div><div><div>type Data{</div><div> string Survey_data;</div><div> string Field_data;</div>
<div> string Strategy_data;</div><div> string quadui_outdir;</div><div>}</div></div><div><br></div><div>Here is the Swift loop that I am using to process this data:</div><div><br></div><div><div>Data d[] = readData(@arg("data"));</div>
<div>/* run quadui */</div><div>foreach ditem in d{</div><div>tracef("Survey data is: %s", ditem.Survey_data);<br></div><div>}</div></div><div><br></div><div>In the output, I get the whole first row of the file instead of the expected first field. </div>
<div><br></div><div>Any clues?</div><div><br></div><div>Thanks,</div><div>Ketan</div></div>