I am trying to read all lines in a text file.getting error message as below

image
looking for solution … Please help

@valli165

you have to use System.IO.File.ReadAllText(“FilePath”)

Regards,
Mahesh

1 Like

Its working! Thanks a lot…:slight_smile:

Need one more help- i need to delete all the files in a particular folder… how to do that?

@valli165

LstFilePaths= Directory.GetFiles(“FolderPath”).ToList

Next Run ForEach and Use Delete Activity inside ForEach.

Regards,
Mahesh

there will be only .txt files in that folder… can i use delete file -folderpath+"*.txt"?

@valli165

I think if you use like that it wont work.
Regards,
Mahesh

How to do below calculation:
a and b are variables.
a=10
b=10
a+b-1

You can use in Assign Activity like below

C= a+b-1

Regards,
Mahesh

i am using assign activity only–

@valli165

I think your variables are string type. Before adding first convert the variables to Integer or double type. And result also should be double or integer Type.

Regards,
Mahesh

Thank you!