Fri Aug 17, 2018 3:05 am
Login Register Lost Password? Contact Us


Spraying a txt file?

Comments and questions related to the Enterprise Control Language

Mon Nov 13, 2017 8:21 pm Change Time Zone

Hi there!

I am trying to spray some text files and was wondering if that is something HPCC supports. I always have CSV's that I spray on the thors, so I am not sure how this works.

Thanks!

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

Tue Nov 14, 2017 9:59 am Change Time Zone

Katy,

Spray Delimited can spray any variable-length file format that has a record delimiter. Most text files have either CR/LF or NewLine delimiters, and these are the default record delimiters for Spray Delimited. So a text file can be sprayed the same way as a CSV file, because in effect, a text file is just a CSV file that happens to only contain a single field per record.

So Spray Delimited the text file, making sure to check the Omit Separator box to make it absolutely clear that it's just a variable-length record file with record delimiters but no field separators. Then you define the sprayed file with a single variable-length STRING field and you're GTG.

HTH,

Richard
rtaylor
Community Advisory Board Member
Community Advisory Board Member
 
Posts: 1369
Joined: Wed Oct 26, 2011 7:40 pm

Tue Nov 14, 2017 2:42 pm Change Time Zone

Hi Richard,

What if I wanted tab delimiters for this text file. Is it possible to still do that?

Thanks!

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

Tue Nov 14, 2017 3:29 pm Change Time Zone

Katy,
What if I wanted tab delimiters for this text file. Is it possible to still do that?
Yes, absolutely. Just change from the default to \t for tab delimiters.

HTH,

Richard
rtaylor
Community Advisory Board Member
Community Advisory Board Member
 
Posts: 1369
Joined: Wed Oct 26, 2011 7:40 pm


Return to ECL

Who is online

Users browsing this forum: No registered users and 1 guest

cron