Skip to content

CSV Row Count Command: csvRowCount

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

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

Steps to Configure:

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

Outcome on execution:

  • The command successfully reads the specified CSV file and returns the number of rows present (including the header row).
  • 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., ${RowCount}).

Back To Top