How to delete data present in a text file
Hello!
Could you be more specific?
Regards,
I want to clear or delete data present in notepad based on condition
clear or delete data present in notepad based on condition(i.e for example if notepad has three rows then delete data from notepad)
CTRL+A hotkey is not working,as before this need to click on somewhere in notepad ,how to do this activity
Maybe use Type into again to type empty string (“”) and ensure Empty field checkbox is checked.
when using type into or send hotkeys option-use " indicate on screen" to point out the open notepad application.
use lowercase letters for shortcuts - Eg ctrl+ ‘a’ (not ‘A’)
@ndivya, Not sure about your exact requirement ! But why not give a try ?
- Read text file → Save to string variable
- Manipulate string (Use string.Remove) and remove unwanted rows from it
- Write back to a text file
Regards,
Dominic
Thanks for your answers
I am using read text file activity, then used send hotkey Ctrl+a still it didn’t worked.
My requirement is i have three rows in text file just want to delete them .
Quick Google showed:
File.WriteAllText(path, String.Empty)
In UiPath that would be:
Thank you ,It’s working now
i am not getting it…
please help…
Thanks,
Suresh.
OP, Did you ever figure it out? I am trying to figure out a similar issue and wanted to see. For me, I need to search through the rows of a .txt file and if there is a ‘123456789’ found, cut that row and paste into a separate notepad file. Your issue seemed to fit some of that.