Hi, i want to ask. is it possible to read an csv file with dynamic names ?
in my case, i need convert the csv into excel, but the file names is different each day.
the filename_object is same, but the yy-mm-dd is different eachday
because i download the files eachday in morning.
i hope you guys understand ( sry for bad english )
You already have the answer, just pass the filename dynamically into the activity property.
I’m just assuming it will be the current day’s date.
"filename_"+Now.ToString("yy-MM-dd") + ".csv"
Hope this helps
hi, how to do that ?
i mean how to add the expression
Let’s say you are using Read CSV activity and passing path to it in one of the activity property.
Just pass the below,
<folderpath> + "filename_"+Now.ToString("yy-MM-dd") + ".csv"
Hope that helps
awesome, i’ll do that and tell you if works
i got problems, they said could not find the file.
is my expression is right ?
i know the problems,
the file month is 4 instead 04.
how to get the 4 without zero ?
i remove the first M, and its works.
but i wonder how about month in 10, 11 , 12 ?
because i remove the first M
It will be auto handled no worries with single M.
If you are downloading and using it then you can get the latest downloaded file from the download folder. Please see the below expression. (Expression will return you the file path.)
Directory.GetFiles(yourfolder_path,"*.txt").OrderByDescending(Function(d) New FileInfo(d).CreationTime).Tolist(0)
You are using it to extract the data then you don’t need to pass the dynamic name you can simply do it in above way.
If you want the file name for other purpose then do it as suggested by @Nithinkrishna