Check if the data exists in CSV file?


#1

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:


#2

#3

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???


#4

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


#5

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


#6

Can you paste the screenshot of your logic?


#7


#8

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

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


#9


#10

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


#11

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!


#12

Paste the screenshot of that logic


#13

this the error message


#14

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


#15

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


#16

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


#17

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