Wed Jan 19, 2022 7:59 pm
Login Register Lost Password? Contact Us


Comments and questions related to the Enterprise Control Language

Tue May 24, 2011 7:33 pm Change Time Zone

When I spray a file. How do I know the fields/column names that are created?
Are there ways of referencing column 1, column 2, etc...?
Can I assign column names before or after a file has been sprayed.

FWIW, I sprayed a csv file and there are no headers in the file, the first through last lines are lines/rows of data.

Posts: 8
Joined: Wed May 11, 2011 3:28 am

Tue May 24, 2011 8:09 pm Change Time Zone

First spray the file. The file structure is specified at read time not spray time.

At the point in ECL when you define the dataset that will read the logical file you sprayed, you will define the matching record structure. Something along this line....

rIn :=
varstring column1;
varstring column2;
varstring column3;

dIn := dataset('<logicalfilenamehere>', rIn, csv);

More detailed info is in the Language Reference which is useful because it covers additional details like specifying a heading, delimiters etc, which I haven't covered here.
Posts: 59
Joined: Wed May 11, 2011 1:54 pm

Tue May 24, 2011 8:13 pm Change Time Zone

Gotcha, I was going from the already structured IMDB demo.
Posts: 8
Joined: Wed May 11, 2011 3:28 am

Return to ECL

Who is online

Users browsing this forum: No registered users and 1 guest