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:
- Select Set a Variable from the Action dropdown.
- Enter a variable name in the Element Key field (e.g., ColumnCount). This variable will store the number of columns.
- Click on Form to open the configuration window.
- Select Functions from the dropdown, then choose File handler Functions.
- In the Cmd field, select csvColumnCount.
- Provide the following parameter:
- file: Path to the CSV file (e.g., C:/Data/InputData.csv).
- Click Save.


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}).