WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: stanl on October 20, 2023, 05:01:37 AM

Title: Another stab from the past
Post by: stanl on October 20, 2023, 05:01:37 AM
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
based on that can issue SQL, based on ADODB connection


Code (WINBATCH) Select

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


Title: Re: Another stab from the past
Post by: td on October 20, 2023, 03:10:29 PM
Nice. Might have to add that to the Tech Database if it isn't already there. Could ease syntax searching for others. I am sure there are "modern" ways to perform the task, but bright-shiny-and-new doesn't necessarily equate to better.
Title: Re: Another stab from the past
Post by: stanl on October 21, 2023, 04:58:29 AM
Quote from: td on October 20, 2023, 03:10:29 PM
Nice. Might have to add that to the Tech Database if it isn't already there. Could ease syntax searching for others. I am sure there are "modern" ways to perform the task, but bright-shiny-and-new doesn't necessarily equate to better.


You can search for 'isam' in Tech Database... a couple of good examples from around 10 years ago. All the new Power Query, Power BI, Tableau is great for working with data in a variety of formats, but ADO is still very fast and efficient.
Title: Re: Another stab from the past
Post by: td on October 21, 2023, 09:02:49 AM
Certainly a bunch of interesting stuff results from a search with the term "isam".