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 Field | Name | Description |
---|---|---|
TAX | column name | this must match CSV column exactly (case-sensitive). |
‘TAX’ | column name | column names can be quoted. |
“TAX” | column name | the same as above. In delia you can use ' or " as quote delimiters |
‘TAX RATE’ | column name | use quotes if the CSV column name contains spaces |
column(3) | column number | specifies the third column. column numbers begin at one. |
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"});
//...
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