Hi @Craige_Hales,
Thank you so much for the suggestion! I implemented Multiple File Import and have been testing it heavily; I can't find any issues, and it's reading in my 3-digit Version column (and others like it) with the delimiters intact, but still reads the dates in correctly.
From the source produced by the manual Multiple File Import, I got the following:
Multiple File Import(
<<Set Folder( "./" ),
<<Set Name Filter( "verTest.csv" ),
<<Set Name Enable( 1 ),
<<Set Size Filter( {100, 100} ),
<<Set Size Enable( 0 ),
<<Set Date Filter( {3666002110.40841, 3666002110.40841} ),
<<Set Date Enable( 0 ),
<<Set Add File Name Column( 0 ),
<<Set Add File Size Column( 0 ),
<<Set Add File Date Column( 0 ),
<<Set Import Mode( "CSVData" ),
<<Set Charset( "Best Guess" ),
<<Set Stack Mode( "Table Per File" ),
<<Set CSV Has Headers( 1 ),
<<Set CSV Allow Numeric( 1 ),
<<Set CSV First Header Line( 1 ),
<<Set CSV Number Of Header Lines( 1 ),
<<Set CSV First Data Line( 2 ),
<<Set CSV EOF Comma( 1 ),
<<Set CSV EOF Tab( 0 ),
<<Set CSV EOF Space( 0 ),
<<Set CSV EOF Spaces( 0 ),
<<Set CSV EOF Other( "" ),
<<Set CSV EOL CRLF( 1 ),
<<Set CSV EOL CR( 1 ),
<<Set CSV EOL LF( 1 ),
<<Set CSV EOL Semicolon( 0 ),
<<Set CSV EOL Other( "" ),
<<Set CSV Quote( "\!"" ),
<<Set CSV Escape( "" )
) << Import Data;
To integrate that into my import function (which takes the path as a parameter), I only had to populate the first two methods correctly:
Convert_csv_to_jmp = Function( {path},
:
:
// determine folder and file args for Multiple File Import function.
lastSlash = Contains( path, "/", -1 );
dir = Substr( path, 1, lastSlash );
If( Length(dir) == 0,
dir = "./";
);
file = Substr( path, lastSlash+1 );
Write( "Path: ", dir, "\!nFile: ", file, "\!n" );
Multiple File Import(
<<Set Folder( dir ),
<<Set Name Filter( file ), // import files with this name.
:
I would appreciate if someone from the community could link to some good documentation on this function. I would like to understand what all the methods are doing. For example, Set Date Filter appears to want some very arcane arguments.