Input Columns

Each row in the input function defines a mapping between a column in your CSV file (or other data source) and a struct field.

  POINTS -> c.loyaltyPoints

There are several ways to define a column:

Input FieldNameDescription
TAXcolumn namethis must match CSV column exactly (case-sensitive).
‘TAX’column namecolumn names can be quoted.
“TAX”column namethe same as above. In delia you can use ' or " as quote delimiters
‘TAX RATE’column nameuse quotes if the CSV column name contains spaces
column(3)column numberspecifies the third column. column numbers begin at one.

CSV Header Row

If the CSV file has a header row, Delia will use it to determine column names.

If there is no header row, you can use column numbers (column(*i*)). Or the CSVFileLoader class has methods for providing column names in Java:

CSVFileLoader fileLoader = new FileLoader('/tmp/customers.csv");
fileLoader.setColumnNames({"ID", "TAX RATE", "REGTION"});
//...

Synthetic Columns

Sometimes the CSV file does not have columns for all the fields in the target Delia type. Use a synthetic column to provide a constant value for a field. Instead of a column name, use the value function to provide a value.

 value(0.07) -> c.defaultTaxRate