So, I'm automating a payment import system, writing the whole thing from scratch. It has to pull data from excel files (including extraneous data that we need to discard), process it, and insert it into a database. Oddly, those aspects are going quite well. However, I'm running into a problem selecting the files that I need to import.
Now, since each file name has some variation of the date in it, I started working by parsing the date out of it, and then checking to see if it was more recent that the date stored in my config file. However, since the filenames are irregular, that's not going to work elegantly. The only way I can see to keep that working involves an ugly if-else chain.
A friend suggested that I just add a couple of tables to the database and keep track of ALL the files I've ever added to it, in addition to the data itself. That seems kind of cruft-ey to me.
Does anyone have an idea better than "store all the files you've ever used" or "have an ugly if-else tree"? If you do, it would be much appreciated!