Sub project CSV or XLS

Lets say you have a three tier project structure - “master project” / “dispatcher” / “sub-projects”.
The Master Project starts with a list of filenames and unique projects to run per filename - it passes these to the dispatcher which in turn calls the sub-project together with the file to upload.

But what if you don’t know before hand whether your file that you want to run project X with, will be a CSV or XLS file.

The problem I am anticipating is that sub-project X starts with an import action - and you have to specify up front whether that import will be of an xls or csv.

Is there a way round this, e.g. call project X.a if csv extension, but call project X.b if xls extension. I guess I could structure a table in the Master Project with exactly this logic, i.e. for every single project, I create two versions - an excel import version and a csv import version. My parameter table in the Master project then has a ProjetToRun column which is calculated on the file extension.

Is there anything simpler that could do the same trick?

There are at least 2 approaches:

Variant 1: Have separate subprojects – one that loads XLS, another that loads CSV. Use expression that calculates what subproject to run in the dispatcher by looking at the file extension. E.g.

if( [File extension] = '.csv', 'load_csv.morph', 'load_xls.morph')

Variant 2: Before processing data just run a helper project to convert existing CSVs into XLSs. Then all your data will be in the same file format.