optn
wks.DC.optn$
Get or set connector settings as a string. Supported only for CSV, Excel etc connector types using its own GetN dialog.
EX1
// import a “*.pil” file by specifying the main header ending text. String fname$ = “C:\Downloads\MyFiles\pilFiles\testfile-20201204_151244.pil”; dlgfile group:="*.pil"; wbook.dc.add("CSV"); wks.dc.source$ = fname$; Tree tr=wks.dc.optn$; tr.settings.mainheader = 0; // Main header lines: -1=Auto, otherwise number of lines tr.settings.endmh$=">END OF headER"; tr.settings.heading = 1; // Data has column name: 0=No, 1=Yes tr.settings.unit = 0; // Data has units: 0=No, 1=Yes tr.settings.comment1=0;//no comment line tr.tostring(wks.dc.optn$); wks.dc.import();
EX2
//partial import HTML table and rename sheet by trimming prefix "_" newbook; wbook.dc.add("HTML"); wbook.dc.source$="https://www.extremeweatherwatch.com/cities/boston/year-1993"; wks.dc.sel$="Tables/_2"; Tree tr = wks.dc.optn$; tr.partial_col$="2 3"; //partial import 2&3 columns tr.nameoptn$="2:0"; //trim head "_" tr.ToString(wks.dc.optn$); wks.dc.import();