Sat Feb 22, 2020 4:29 pm
Login Register Lost Password? Contact Us


Having issues with Spraying my CSV file

Comments or questions specific to the features of ECL Watch

Tue Jun 20, 2017 8:18 pm Change Time Zone

Hi there!

I've been trying to spray my CSV file for most of the afternoon. I think my settings are correct, but somehow once my file is done spraying the columns are not separated as I was expecting.

Here are the settings when I spray:
Format ASCII
Max Record Length 8192
Separators ,
Line Terminators \n,\r\n
Quotes "

When I view context after my file has sprayed, it looks like it did not recognize my separator. Am I missing something here?

Thanks!

Katy
KatyChow
 
Posts: 26
Joined: Mon Jun 02, 2014 3:16 pm

Wed Jun 21, 2017 7:30 pm Change Time Zone

Katy,

I think your issue is in the manner in which it displays in ECL watch and not with the spray.

Try OUTPUT(yourdataset) and you should see your columns.

There is a Jira issue for the display in ECL Watch:
https://track.hpccsystems.com/browse/HPCC-11535zz

HTH,
Jim
JimD
 
Posts: 147
Joined: Wed May 18, 2011 1:35 pm

Wed Jun 21, 2017 7:35 pm Change Time Zone

Hi Jim,

Even when I look at the data structure, it's only 1 string field. Are you saying it will be different when I output this file?

THanks!

Katy
KatyChow
 
Posts: 26
Joined: Mon Jun 02, 2014 3:16 pm

Wed Jun 21, 2017 9:23 pm Change Time Zone

Yes, exactly.
Here is some code I have handy (might not be the best code, but it shows you what I mean)

Code: Select all
//Assumes this is a CSV file (comma separated, new line terminated) exists and
// sprayed to Thor as ~test::testme.csv
/*
1,312,"Joe","Smith"
2,433,"John","Doe"
3,513,"Jim","Jones"
*/
MyFileLayout := RECORD
STRING num;
STRING id;
STRING Fname;
STRING LastName;
END;                     

MyDataset := dataset ('~test::testme.csv', MyFileLayout,CSV(separator(',')));
OUTPUT(MyDataset);


This is the result in the IDE:
The attachment TestCSVOutput.png is no longer available


HTH,
Jim
Attachments
TestCSVOutput.png
(25.56 KiB) Downloaded 544 times
JimD
 
Posts: 147
Joined: Wed May 18, 2011 1:35 pm


Return to ECL Watch

Who is online

Users browsing this forum: No registered users and 1 guest

cron