Files name are in this format ABCD-1234588_07-19-2023-13-56.xlsx
i want to check till ABCD-1234588_07.xlsx by using path exist activity.
if files exist then it
ABCD , 1234588 ,07 are stored in individual variables
@Luffy
Use path.GetFileName(“Your FileName”)
Use regex
[A-Z]+(?=-)-1st
(?<=-)\d{2,}(?=_)-2nd
\d+(?=.xlsx)-3rd
Can we do that “Data\Input"+“ABCD”+”-“+“1234588”+”_“+“07”+”*.xlsx" ?
Can anyone help me in this scenario?
hey @Luffy
U can try it
also u can try the below solution
Directory.GetFiles(folderPath, “ABCD”+”-“+“1234588”+”_“+“07”+”*.xlsx")
I have already implemented that solution but still not getting the correct output
Can u explain me more detailed
If you have multiple file and want to check if all those are existing
Then you can try using wildcard * in the name
So here i have used wildcard * in the name so that it can loop through all the files which start from localsheet
So if i had to give you an example then it will loop through
localsheet1.xlsx
localsheet2.xlsx
localsheet3.xlsx
And iterates until there is no more files available which start from localsheet
What output you are getting in both these methods
If possible share the input data
You have different files starting with differnt names but as you can see the date is same for every file
so use wildcard before the date and after the date as time is changing
Instead of this : 1100-2110000000_07-19-2023-12-30
use : 07-19-2023.xlsx
actually what i want is
1100 stored in variable var1
2110000000 in var2
07 in var3
expression - var1+“-”+var2+“_”+var3+".xlsx
(1100-2110000000_07) i need to perform action on this values.
input_string = “1100-2110000000_07”
var1 = input_string.split(“-”)[0]
var2 = input_string.split(“-”)[1].split(““)[0]
var3 = input_string.split(””)[1]
try this
Try this:
“C:/foldername/”+var1.tostring+“-”+var2.tostring+“-”+var3.tostring+“.xlsx”
can you please share the flow
Hey @Luffy ,
Please check this workflow
is this what you want?
ChooseFile.zip (2.4 KB)
Note : Please change the Folder path accordingly
Regards,