ImportCSV
The ImportCSV() function retrieves data from an external CSV (comma-delimited) file. It allows users to import specific columns that meet user-defined criteria.
Related functions: ImportExcel, ImportODBC, ImportText
Syntax:
Qx.ImportCSV(File, Filter Expression, Columns)- In Excel with Quintessence addin versions prior to 25.1, use:
ImportCSV() - In the Quintessence Editor (Studio) using Quintessence language, use:
ImportCSV() - In the Quintessence Editor (Studio) using Python language, use:
Qx.ImportCSV()
ⓘ See parameter descriptions
| File | The path to the CSV file to import. |
| Filter Expression (optional) | The expression representing the filter criteria to apply to the data. |
| Columns (optional) | The columns to return, represented as Cn. By default, columns are imported as text. The format can be changed using the following options:• Convert column to number: Cn:N• Convert column to date: Cn:D• Convert column to text: Cn:T |
Remarks:
- Unless changed by an administrator, the default parameters are:
- Filter Expression: No filter is applied to the imported data.
- Columns:
*(all columns are imported).
Examples:
The examples provided below are based on fictitious data for illustrative purposes only.
> Example 1: Import a CSV file into Excel without the header lines
Assume the CSV file is located at:
C:\Quintessence\ExcelPing.csvThis import can be achieved using the following formula:
=Qx.ImportCSV("C:\Quintessence\ExcelPing.csv", "Line > 1")> Example 2: Import data that meets a criterion and output specific columns
Assume the CSV file is located at:
C:\Quintessence\ExcelPing.csvWe require all rows where the third column contains a value greater than 100, and the data should be returned ensuring that column three is in numeric format. This import can be achieved using the following formula:
=Qx.ImportCSV("C:\Quintessence\ExcelPing.csv", "C3 > 100", "C1,C2,C3:N")