If your automation needs to chew through CSVs without staging a melodrama, this guide shows how to do it in UiPath Studio like a competent robot. We will read a CSV into a DataTable, filter or mutate rows, then write the result back to a new file. You get clean output, better error handling, and fewer support tickets at 2 a m.
High level first so you feel smart before the details hit. The flow looks like this
Drag the Read CSV activity into your sequence. Point FilePath to the source file and save the output to a DataTable variable such as table
or dtInput
. If your file uses tabs or pipes instead of commas, set the delimiter accordingly. If you want culture aware parsing, set the appropriate culture so numbers and dates do not fight you.
row("ColumnName").ToString.Trim()
Want rows where Age is over 30 Use the Select method to pick them
Dim selected = table.Select("Age > 30")
Dim filtered = If(selected.Any, selected.CopyToDataTable(), table.Clone())
Yes you must validate before CopyToDataTable because it throws if the selection is empty. A safe pattern is to check selected.Any
or verify selected.Length > 0
first. For column edits loop with For Each row in table and assign values like
For Each row As DataRow In table.Rows
row("Status") = SomeNewValue
Next
Use DataTable.Select
for quick filters, and LINQ to DataSet when you need more complex transformations. Both keep you in-memory and fast enough for typical RPA CSV handling scenarios.
Use the Write CSV activity. Set the Input to your DataTable variable and the FilePath to the output location. Decide whether to overwrite or archive previous files. Archiving is the polite choice when you want to explain mistakes to auditors later.
Protect your workflow with a few proven checks
table IsNot Nothing
and table.Rows.Count > 0
before calling CopyToDataTable
So the practical pipeline in UiPath Studio looks like this. Read CSV into a DataTable, optionally filter or modify rows with Select or a For Each loop, validate the result, then Write CSV. Add Try Catch blocks around file IO, trim values early, and set a culture aware delimiter if needed. That gives you reliable CSV handling for RPA automation without drama.
If you follow these steps you will have a maintainable UiPath workflow that reads writes and filters CSV files, and you will have earned at least some respect from ops. Now go automate something.
I know how you can get Azure Certified, Google Cloud Certified and AWS Certified. It's a cool certification exam simulator site called certificationexams.pro. Check it out, and tell them Cameron sent ya!
This is a dedicated watch page for a single video.