Check if the data exists in CSV file?

Hi guys,

can you please tell me how to check if the data exists in CSV file, what’s is the IF condition format? and from where can I get information when it comes formats of the different conditions? (I already know about Uipath on youtube)

for example I want to check if the first name and last name exists

thanks :slight_smile:

https://www.uipath.com/kb-articles/how-to-read-data-from-a-csv-file

Thanks man but I already know how to read CSV file , what I want is to know how to check the (first name) exists if not write it in text file! I need the if condition here, right???

In example there is foreach loop, inside foreach loop check

If ( row(“firstname”).tostring = string.empty)

Use Write text file activity here to write to textfile

it shows and error saying ( option strict on disallows implicit conversions from string to integer

Can you paste the screenshot of your logic?

You don’t need to mention “if” again inside the textbox

row(“First Name”).ToString = string.Empty

This code needs to be in for each loop as shown in above example link.

thank you

when I run the program it works fine but stops when the First Name not found and its not written in the text file!

Paste the screenshot of that logic

this the error message

This error is not related to for each , it’s from a grid view you are reading values.

what do you mean? and how can I fix it ?

sorry I know I’m such pain but can you help me in this too!

For this…You need to change typearguement to datarow in foreach properties.