1

I have multiple folder named after the year\month\days. It's in a Azure blob storage if that change anything, I already have the code that download files from the blob storage. Like:

  • 2020
    • 01
      • 01
        • filetest_20210101_133035.csv
        • filetest_20210101_183035.csv
        • otherfile_20210101_183035.csv
      • ...
      • 31
    • 02
    • ...
  • 2021
    • 01
      • 01
    • 02
    • ...
  • ...

And I have a table in a SQL database with wildcards and the last datetime the file was downloaded (the same datetime in the file name).
WildCardTable

I need to download all the files that match the wildcard and is after the date retrieved from the SQL table (column LastDateTime). I assume it will be heavy to search all the folder for the wildcard, especially when there will be multiples years of data.

I guess I can just add the download function in a if statement to verify the date like so:

if ([Date time part of the name file] > [my variable with the LastDateTime])
{
DownloadFromBlob([filename]) //Custom function
}

But I don't want to go through all the folders.

What is the best approach to do this in C# (.NET Framework 4.7)?

Bradford1138
  • 65
  • 1
  • 1
  • 7

0 Answers0