views:

594

answers:

2

Was wondering if there was a way to put a wildcard in the schema.ini for example [*.txt] FMT=TabDelimited

I've got an app that is imported tab delimited files and the only place I can seem to get the FMT="TabDelimited" is in the schema.ini (doesn't work in the connection string for some reason), but I will have no idea what the filenames are other than the txt extension.

BTW I'm connecting using an OdbcConnection and the Microsoft Text Driver.

+1  A: 

I guess I could potentially rename the file temporarily to match whatever I decide to put in the schema.ini or potentially modify the schema.ini on the fly and put the correct filename in there, but I'd love to do know if there was a better way.

Jeremy Coenen
I went ahead with modifying the schema.ini on the fly for each file.
Jeremy Coenen
A: 

A single schema.ini file can contain multiple [fileName.txt] entries and format descriptions, (for all the files in the Directory), so you might consider creating the .ini file dynamically from the directory file names.