Using the Open action for CSV/TXT file
- Updated: 2022/11/14
This action enables you to specify the delimiter used in the file, whether to trim the spaces, and the encoding applied on the file.
Note:
- If there is a double quotation mark (") in the last element of the last line of the CSV/TXT file, at runtime the bot will encounter an error.
- When you use the action to open a CSV file, read it, and assign it to a table, then write it to a file using the Data table > Write to file action, any commas in the header or cell data are treated as delimiters. For instance, if three consecutive cells contain data like "abc", "bcd", "efd", the final output will enclose each in triple double quotes, resulting in """abc""", """bcd""", """efd""".
Procedure
To open a CSV or text file, do the following:
Next steps
Use the Read action to retrieve the data from CSV/TXT file and assign them to a table variable. You can use the loop action to retrieve each row of data from the file or table variable and assign them to the record variable for further operations.