Read CSV file with dynamic name. Wildcards use?

Hi. I’m trying to open a CSV file that I recently downloaded.
The name of the file is different every time. How do I read the latest one? I tried to use wildcards and got “Read CSV: Illegal characters in path.”
Thank you!
csv|690x462

Hi @go4serg ,

When you download the file just save it in another name instead on present name and pass the same name to read the file.

If you are download the file using chrome just enable the below option in the setting

Hi, have you try using - “filepath\sales-summary-*.csv” ?

Use this to get the latest file. Let me know if this helps you.

1 Like

I tried that and I get:
Read CSV: Illegal characters in path.

I’m making an unattended robot. So this solution wouldn’t be enough

@go4serg - Once the file succesfully downloaded…you can read that file using the create time…use the below code…This code, pulls first file based on the create time.

StrFile = Directory.GetFiles(“YourFolderPath”).OrderBy(Function(d) New FileInfo(d).CreationTime).first

Thank you, thank you. This is exactly what I was looking for. Works perfect.
For my information, what does Function(f) do?

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.