Having issues with Spraying my CSV file
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
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
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
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: 160
- Joined: Wed May 18, 2011 1:35 pm
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
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
Yes, exactly.
Here is some code I have handy (might not be the best code, but it shows you what I mean)
This is the result in the IDE:
HTH,
Jim
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:
HTH,
Jim
- Attachments
-
TestCSVOutput.png
- (25.56 KiB) Downloaded 544 times
- JimD
- Posts: 160
- Joined: Wed May 18, 2011 1:35 pm
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest