I wanted add data in existing text file. How can I do it instead of write text file activity
Any suggestions would be helpful .
Thanks,
Nawaz.
I wanted add data in existing text file. How can I do it instead of write text file activity
Any suggestions would be helpful .
Thanks,
Nawaz.
@Mohammed_Nawazuddin
try this as well (invoke code)
String data=File.ReadAllText(“filepath”)
data.append(“data to append”)
File.WriteAllText(“filepath”,data)
Hello @Mohammed_Nawazuddin
You can use Append Line activity. If the file is already existing then it will use that file, else it will create a new text file.
Hi Jack,
Thanks for you message. I tried the above code and getting bit error.I am not what is data in it. Is it string variable. I have my all data in read_data variable. Please validate the below codeeand let me know if any change needs to be done.
Thanks,
Nawaz.
this will work @Mohammed_Nawazuddin
using (invoke code c#)
File.AppendAllText(@"C:\Users\Mohammed.Nawazuddin\OneDrive\Documents\UiPath\Write\processApp.txt", read_data + Environment.NewLine);
Main (1).xaml (7.0 KB)
Instead of path I am trying to pass the variable but its getting faulted.Please look into the xaml fi
Main.xaml (5.5 KB)
le
here
Main (2).xaml (5.5 KB)
dont name your variable File, because File is a name of the module e.g. File.WriteAllText
if you have a variable named File uipath will get confused, it doesnt know whether you’re referring to the variable/module name
Hi Jack,
Its working in my local machine but the same logic is not working in my client system. Please find the below screenshots
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.