CSV to Excel

Discover more about the CSV to Excel component and how to use it on the Digibee Integration Platform.

CSV to Excel converts CSV format into XLSX files. You can create only one Excel file per execution.

Parameters

Take a look at the configuration options for the component. Parameters supported by Double Braces expressions are marked with (DB).

ParameterDescriptionDefault valueData type

Multiple Sheets

If the option is active, multiple CSV files will result in multiple sheets; otherwise, only one Excel file will be created.

False

Boolean

Sheet Information

When you click Add, you activate the parameters CSV File Name, Sheet Name Destination, and CSV Delimiter. With these parameters, you can import table data from CSV files into the sheets of the Excel file (this is only possible if the Excel file contains more than one worksheet tab).

N/A

Options of Sheet Information

CSV File Name (DB)

Name of the CSV files to be imported. This parameter is also available if Multiple Sheets is not active.

file.csv

String

Sheet Name Destination

Name of the tab that should receive the data from the CSV file.

N/A

String

CSV Delimiter

Delimiter of the CSV file.

N/A

String

Excel File Name

Name of the file to be saved - if the field is empty, the "fileName" property will be considered.

file

String

Maximum File Size

Maximum size allowed for the file (in bytes). This parameter is optional. It only needs to be used if the user wants more control over the generated file. Note that the generated Excel file will probably be larger than the CSV input data.

1048576

Long

Charset

Name encoding for the file reading.

UTF-8

String

Sheet Name

Name of the Excel sheet. If the field is empty, the sheet will be saved as "Sheet1".

Sheet

String

Delimiter

Delimiter in which the CSV is configured.

, (comma)

String

Fail On Error

If the option is enabled, the execution of the pipeline with error will be interrupted; otherwise, the pipeline execution proceeds, but the result will show a false value for the "success" property.

False

Boolean

Column Properties

When you click on Add, you activate the parameters Column, Date Format, and Column Type. With these parameters, you can assign data types to the columns in the Excel file to be created.

N/A

Options of Column Properties

Column

Column that contains the data to be treated.

N/A

String

Date Format

Date format to be used if the column type is Date (for example: Column Type = Date).

dd/MM/yyyy

String

Column Type

Data type of the column.

Number

String

Set password

If this option is enabled, you will be able to set a password to protect the Excel output file.

False

Boolean

Password (DB)

Excel file password. This parameter is only available if Set password is active. This field supports text characters, as well as Double Braces expressions.

N/A

String

CSV to Excel in Action

Using multiple CSV files at once

You must enable the Multiple Sheets option to specify multiple CSV files when creating new sheets. This is for existing or non-existing Excel files.

If you need to create new sheets within an existing Excel file, you must specify the name of this file in the Excel File Name field. This way, the file will be updated with the new sheets.

However, if you want to create a new Excel file with these sheets, do not fill in the Excel File Name field (or fill it in with the name of a non-existing file).

Using a CSV file

In the Excel File Name field, type the name of the CSV file to use when creating a new sheet.

If you need to create new sheets within an existing Excel file, enter the name of this file in the Excel File Name field. This way, the file is updated with the new sheets.

However, if you want to create a new Excel file with these sheets, do not fill in the Excel File Name field (or fill it in with the name of a non-existing file).

We do not recommend creating a new sheet in an existing and big Excel file (with one or more sheets with a great amount of data), because it is necessary to open the entire Excel file to create the new sheets, and that consumes a lot of memory. On the other hand, this does not happen when creating a new Excel file with multiple sheets at once - in this case, a stream is used in the creation process.

Configuration examples

The example you see below results in the creation of an XLXS file. All CSV columns and rows are read in as string:

{
"type": "connector",
"name": "csv to excel-connector",
"stepName": "csv-test",
"params": {
"fileName": "{{message.fileName}}",
"excelFileName": "file",
"delimiter": ",",
"failOnError": false
}
}

See the configuration types for some columns:

{
"type": "connector",
"name": "csv to excel-connector",
"stepName": "csv-test",
"params": {
"fileName": "{{message.fileName}}",
"excelFileName": "file",
"cellDefinitions": "[{\" column \ ": \" A \ ", \" type \ ": \" NUMBER \ "}, {\" column \ ": \" B \ ", \" dateFormat \ " : \ "dd-MM-aaaa \", \ "type \": \ "DATE \"}, {\ "column \": \ "C \", \ "type \": \ "BOOLEAN \"}] ",
"delimiter": ",",
"failOnError": false
}
}

The manipulation of files within a pipeline is done with all protections in place. All files can only be accessed through one temporary directory, with each pipeline KEY having access to its own set of files.

Last updated