From Origin 2020, Origin File Connector supports SQL query language to select desired data stored in an Origin project file. SQL operates through simple, declarative statements. It makes data extraction more flexible, helps to organize data in an Origin project and maintain them.
SELECT COLUMN FROM Range WHERE Condition
Note: only data column is supported as object used in Origin File Connector.
FROM supports project path, workbook or sheet range notation. Following special keys are also available.
Select columns with specified plot designation.
//search the whole project and select unhidden X columns Select Column from Project where (Column_Type = "X" and Column_Visible = True);
When you select a Y column, it will also import the associated X column.
//search the whole project and select columns with long name starting by “Trial” //and import both the selected columns and their X columns Select Column from Project where (Column_LName like "Trial*" and Column_Y = True);
When you select a Z column, it will also import the associated X and Y columns.
//search the whole project and select columns with long name starting by “Trial” //and import the selected columns and their associated X&Y columns Select Column from Project where (Column_LName like "Trial*" and Column_Z = True);
Select columns of specified short name.
//search the active workbook and select column with short name “A” Select Column from %H where Column_SName like "A";
Select columns of specified long name. Wildcard “*” and “?” are supported. “*” represents any string of characters, and “?” represents any single character
//search the whole project and select column whose long name starting with “Trial” Select Column from Project where Column_LName like "Trial*";
Select columns whose Comment matches the specified condition. Wildcard are supported.
//search the whole project and select column with comment starting by letter “S” and end by digit “3” Select Column from Project where Column_Comments like "S*3";
Specify to select from the visible columns or hidden columns.
//search the whole project and select the hidden Y columns Select Column from Project where (Column_Type = "Y" and Column_Visible = False);
Select columns whose Parameters n header line matches the specified condition. Wildcard characters are supported
//search the whole project and select columns whose Parameter 1 including character “y”. Select Column from Project where Column_P1 like "*y*";
Select columns whose User-Defined Parameter n matches the specified condition. Wildcard characters are supported
//search the whole project and select columns whose Parameter1 including character “y” //and value in the 1st User-Defined Parameter larger than 3. Select Column from Project where (Column_P1 like "*y*" and Column_D1 > 3);
Select columns whose User-Defined Parameter named SampleID matches the specified condition. If name has space characters, use [SampleID]. Wildcard characters are supported in the condition.
//search the active folder and select columns whose parameter row “Population Mean” is larger than 100. Select Column from ACTIVEFOLDER where Column_[Population Mean] > 100;
Select columns in worksheets of Short Name matches the specified condition. Wildcard characters are supported
//search the Favorite folder and select columns in sheets named “Trial…”. Select Column from FAVORITEFOLDER where Sheet_SName like "Trial*";
Select columns from Project where sheet Comments match the specified condition. Wildcard characters are supported.
Select Column From Project Where Sheet_Comments like "Sheet1" and Book_Comments like "Book1"
Select columns from Project where book Comments match the specified condition. Wildcard characters are supported.
Select Column From Project Where Book_Comments like "Trial Run*"
Select columns in workbooks of Short Name matches the specified condition. Wildcard characters are supported
//search the whole project and select columns in books with Short Nam beginning with “Book”. Select Column from Project where (Book_SName like "Book*");
Select columns in workbooks of Long Name matches the specified condition. Wildcard characters are supported
//search the whole project and select columns in books with Short Nam beginning with “Book”, //or books with Long Name beginning with “fit”. Select Column from Project where (Book_SName like "Book*" or Book_LName like "*fit*");
Select Column from Project where (Column_LName like "Year" AND Column_Type = X) or (Column_LName like "Value*" and Column_Type = Y)
wo -qn Select Column from ["Austrialia Population from 1960 to 2017"]UnstackCols2! where (Column_Comments like "male*" and Column_N > 5000000);
Note: for details of LabTalk command "worksheet -qn", please refer to this page.