Check if .csv file is empty (also no headers)

DEar Friends,

I am looping an activity to read several downloaded .csv files and need to decide first if the file empty or not. If it is empty, redownload the file. If it is not empty, merge the datatable.
THe problem is, there is some small chance that the downloaded file will be downloaded without even a single header. How to check this first? if I use read csv, UiPath throws an error instantly with the following error message: value cannot be null. Any suggestion?\

Thank you for your help.

Kr,

Nazarius

check file size with Fileinfo.Length

Hi @assesor-rpa,

THanks a lot! great idea.
I use new System.IO.FileInfo(filename).Length to search the length and create an if activity to continue.
Buenos tardes y Muchas Gracias! :slight_smile:

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.