Error
(hacky)
January 11, 2018, 10:27am
1
Greetings all,
I am having certain task where I need to do the following task.
-saving certain value “I like uipath” in a certain .txt file and save that file on the desktop with the name “uipath.txt”
-similarly create a many files with unique names such as (uipath1.txt), (uipath2.txt),(uipath3.txt). and so on…
I just want to do this without trying out every name ie:=uipath1,uipath2,uipath3,etc
Thanks and reagrds,
Error.
@Error
Creat using the datetime stamp so that every time a unqiue number is appended to your file name.
1 Like
Error
(hacky)
January 11, 2018, 11:24am
3
Well, ummm,
that was short detail.
Sorry but i didnt get that . ]
Can you please elaborate?
pathrudu
(KLN Sanyasi Pathrudu Chintakayala)
January 11, 2018, 11:27am
4
@Error create txt file with name value to “uipath”+DateTime.Now.ToString()+“.txt”
Error
(hacky)
January 11, 2018, 11:35am
5
Hey there, thanks it gave me some idea.
But while i tried creating certain file using this method,
I got an error saying that the given filename does not exist…
KatKon
January 11, 2018, 11:39am
6
If You have files like you described: uipath1,uipath2,uipath3 or any other, which You would like just to increase last number, You can use this expression:
Directory.GetFiles(“path”).Select( Function(w) Regex.Match(w.ToString,“\d+”).Value ).Max
It return the gratest number of file, e.g. if You have files uipath1,uipath2,uipath3, it will returns “3”.
It’s a string type and You just have to change “path” value for any full path You want.
Then in creating new file just increase this number by 1.
2 Likes
pathrudu
(KLN Sanyasi Pathrudu Chintakayala)
January 11, 2018, 11:44am
7
writetxtfile.xaml (6.1 KB)
try this
Error
(hacky)
January 11, 2018, 11:52am
8
Well I didnt really understand what exactly am i supposed to do.
Can you please provide me with the workflow if possible.
Error
(hacky)
January 11, 2018, 12:04pm
9
@pathrudu
@priyanka.yadav18
@KatKon
@sictpeng
@12scs169
Hey guys,
check this out.
I am attaching my zip file.
please have a look at the workflow and let me know if you guys have some interests.
I tried using date time stamp but discovered that a new file cannot be created with the file name containing the datetime stamp.
Please have a look at it.
DesktopAutomation.zip (1.1 MB)
pathrudu
(KLN Sanyasi Pathrudu Chintakayala)
January 11, 2018, 12:30pm
10
what do you mean by this?
KatKon
January 11, 2018, 1:33pm
11
CreatingFile.xaml (5.6 KB)
If You have in folder files: UiPath1, UiPath2 and UiPath3, it will create UiPath4.
This example won’t work if You will have any other digits in path except of number of file. If You need it, You can improve it by changing regex - I mean “\d+” part.
P.S. Change the path