Request two entries from the user - file name and text. Then open the notepad,
write the text obtained from the user and save this file with a name you
received from.
b) Treat the task so that if the user enters the name of an existing file, this old file overwritten by a new one.
Note: Develop tasks using the user interface, not systemically. This means that only click and fill-in activities are allowed, and not activities that are saved or saved. overwrite the file.
You can use âInput Dialogâ box activity for Text
Another input Dialog box activity for Filename
Take those values into 2 variables ex:Txtvar , nameVar
Now use âWrite text fileâ activity and in the âFIle nameâ property give the path where you want to save the file and append the FIlename variable
âC/uipath/wofkflow/â+nameVar+â.txtâ
Hi
welcome to uipath community
âuse INPUT DIALOG BOX activity and get the output with a variable of type string named str_filename and mention the label as âenter the filenameâ
âagain use another INPUT DIALOG BOX ACTIVITY and get the output with a variable of type string named str_text and mention the label as âenter the textâ
ânow use a IF condition like this to check whether the use has mentioned the already existing file name @Nastiaitsan Directory.GetFiles(âyourfolderpathâ,â*.txtâ).Contains(str_filename.ToString)
if true it will go to THEN part where we can use
Delete activity and mention the file path as âyourfolderpathâ+â\â+str_filename+â.txtâ
followed by this use WRITE TEXT FILE activity and mention the file path as str_filename.Trim(â.txtâ)+â.txtâ and input as str_text.ToString
or
if the condition is false it will go to ELSE part where we can use directlly the WRITE TEXT FILE activity and mention the file path as str_filename.Trim(â.txtâ)+â.txtâ and input as str_text.ToString
kindly try this and let know for any queries or clarification
Cheers @Nastiaitsan