Hello guys
I have to find single Excel file which available in Folder inside ther folder multiple folders and Excel files is there.
This folder shown in image
And i have used this code shown in below image but this code is creating another file and i don’t want that ,
I want find that file and append the data
Thanks
mlellison
(Max Ellison)
September 7, 2023, 10:01am
2
Hi @suraj_gaikwad
Do you know the Excel file name you are looking for?
If yes, store the name as a string variable, then use “for each folder in folder” activity, and a nested “for each file in folder” activity, use “if” activity to match if current file match the name of your target file
1 Like
Yes, in second image there is name of file end of the code
But scenario is that
After downloading the first excel file and iterate the file and first sequence done
Then bot goes second sequence choose the file like watchlist updated and iterate the data
Den third sequence same proces like this
Four sequence is there.
Thanks
@mlellison
For this you can use a expression like this
arr_filepath = System.IO.Directory.GetFiles(MainDirectory, “*.xlsx”, SearchOption.AllDirectories)
This will get all the filepath from the main directory and it’s sub directories
Is this the scenario u have now
Cheers @suraj_gaikwad
1 Like
arr_filepath = System.IO.Directory.GetFiles(MainDirectory, “*.xlsx”, SearchOption.AllDirectories)
gives output of files
use this in assign gives boolean
booloutput=arr_files.any(function(x) x.contains(“yourfilename”))
hope this helps
system
(system)
Closed
September 12, 2023, 7:37am
6
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.