<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" id="owaParaStyle"></style>
</head>
<body fpstyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Did you try different field separators? I think in the past Ive used spaces. Perhaps the readData() code is not sufficiently white-space-aware yet?
<div><br>
</div>
<div>- Mike<br>
<div><br>
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div><br>
</div>
<div>--</div>
<div>Michael Wilde</div>
<div>Mathematics and Computer Science          Computation Institute</div>
<div>Argonne National Laboratory                    The University of Chicago</div>
<div><br>
</div>
</div>
</div>
</div>
</div>
</div>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div id="divRpF122802" style="direction: ltr; "><font face="Tahoma" size="2" color="#000000"><b>From:</b> swift-user-bounces@ci.uchicago.edu [swift-user-bounces@ci.uchicago.edu] on behalf of Ketan Maheshwari [ketan@mcs.anl.gov]<br>
<b>Sent:</b> Monday, January 13, 2014 11:01 AM<br>
<b>To:</b> Swift User<br>
<b>Subject:</b> [Swift-user] readData is treating line as a single field<br>
</font><br>
</div>
<div></div>
<div>
<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>
</div>
</div>
</div>
</div>
</body>
</html>