Lately facing having to work with text files exported from servers/sharepoints/db's with variable delimiters [, tab , ; , ^ ] or exported as json. Was thinking could still be done with ADO and digging into my archives found scripts from 2002 with the SQL syntax [that was difficult to find with searches]. The only issue was to create a schema.ini file for delimiter. Then for each file to process obtain the
- folder file was in - the parent
- file name - the leaf
- create the schema.ini
based on that can issue SQL, based on ADODB connection
qry = "SELECT * INTO [" :Table :"] FROM [TEXT;DATABASE=" :parent:";HDR=YES;FMT=Delimited].[":leaf:"];"
... schema.ini if text file detected as tab-delimited
[file.txt]
ColNameHeader=True
Format=TabDelimited