Fri Dec 03, 2021 4:44 am
Login Register Lost Password? Contact Us


Fields

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.

thanks
ewadler
 
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 :=
record
varstring column1;
varstring column2;
varstring column3;
end;

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

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.
sort
 
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.
ewadler
 
Posts: 8
Joined: Wed May 11, 2011 3:28 am


Return to ECL

Who is online

Users browsing this forum: Bing [Bot] and 1 guest