I am working on a script to process data files and used the built in script function to generate code. I copy the code from "Source" script and if I run it the data table is recreated as desired. Note: I changed the file name here to protect some confidentiality. I am attempting to read some header information for the report.
If I change "Quoted file Name.csv" to the pick file() function, the data preview window is forced open and the user has to reset all the settings. I have used the same structure before to open the files without the data preview being presented. The only differences here is that I am not reading column labels here as compared to the previous instance.
Open(
"Quoted file Name.csv",
columns(
Column( "Column 1", Character, "Nominal" ),
Column( "Column 2", Character, "Nominal" ),
Column( "Column 3", Character, "Nominal" ),
Column( "Column 4", Character, "Nominal" ),
Column( "Column 5", Character, "Nominal" ),
Column( "Column 6", Character, "Nominal" ),
Column( "Column 7", Numeric, "Continuous", Format( "Best", 10 ) )
),
Import Settings(
End Of Line( CRLF, CR, LF ),
End Of Field( Comma, CSV( 1 ) ),
Strip Quotes( 1 ),
Use Apostrophe as Quotation Mark( 0 ),
Scan Whole File( 1 ),
Treat empty columns as numeric( 0 ),
CompressNumericColumns( 0 ),
CompressCharacterColumns( 0 ),
CompressAllowListCheck( 0 ),
Labels( 0 ),
Column Names Start( 1 ),
Data Starts( 1 ),
Lines To Read( 7 ),
Year Rule( "20xx" )
)
);