Skip to content

CSV Column Count Command: csvColumnCount

The csvColumnCount command under the File Handler function is used to retrieve the number of columns present in a specified CSV file.

Example: You have a sales data file in CSV format, and you want to determine the number of columns.

Steps to Configure:

  1. Select Set a Variable from the Action dropdown.
  2. Enter a variable name in the Element Key field (e.g., ColumnCount). This variable will store the number of columns.
  3. Click on Form to open the configuration window.
  4. Select Functions from the dropdown, then choose File handler Functions.
  5. In the Cmd field, select csvColumnCount.
  6. Provide the following parameter:
    • file: Path to the CSV file (e.g., C:/Data/InputData.csv).
  7. Click Save.
scrn-csv-column-count-command-tabular-view
Tabular View
scrn-csv-column-count-command-card-view
Card View

Outcome on execution:

  • The command successfully reads the specified CSV file and returns the number of columns present.
  • The result is stored in the variable defined in the Element Key.
  • This variable can be used in later steps of your automation process to reference the stored information using the syntax ${VariableName} (e.g., ${ColumnCount}).

Back To Top