6.5.1 Connecting to File


Data Connectors build connections between an Origin worksheet/matrix and a data file on your PC or local network. Many common file types are supported.

For a summary of key differences between Connectors and older import methods, see FAQ-1020 Is there a difference between Connect and Import?.

Connectors for additional file types can be added by choosing the Add New menu item at the bottom of the Data: Connect to File menu. This opens the App Center to show only uninstalled Connectors. Click the Download and Install icon to install the Connector App on your PC.

Alternately, go to the Origin File Exchange on the OriginLab website and select a Connector from the list. On the App page, click the Download File button and when the download completes, drag the file to the Origin workspace. For App documentation, see the App page's Description section.

Adding a Connector to the Book

To add a Data Connector to the book and import data:

  1. With a worksheet/matrix active, choose Data: Connect to File.
  2. Select the desired data file from the Open dialog box.


This opens a Connector-specific dialog box where you can configure your import options.

  • For multi-page files such as MS Excel or MATLAB, you will choose an initial sheet to import (e.g. Excel Sheet). Upon import, a collapsible Data Navigator panel is added to the book giving you access to the files remaining sheets.
  • The name of the connected file is added as the book Long Name (does not apply to CSV or Origin files).
DC Rename book on import.png
  • When connecting matrixbooks to files, Image Mode and Image Thumbnails/Slider are automatically enabled when the number of imported matrices exceeds the value of system variable @MSS (default = 10). Does not apply to Origin files. For information on changing the value of a system variable, see this FAQ.

Text/CSV Connector

Use the Text/CSV Connector to import text files such as CSV, TXT, and ASC.

  • Auto determine Main header lines or clear the check box and specify the main header and the sub-header, including column Long Name, Units and Comments, manually. Hint: a blue hint will show the number of auto-detected Main header lines.
  • When main header lines are detected or manually specified, the import dialog shows a Save file header to drop-down list with options to save the file header to the Worksheet label area or the Book organizer (see image below).
  • You can opt to Import first 50 lines as preview or for partial import.
CSV Import Options CSV Import Options, Main Header Lines
Csv import option dlg.png Csv import option dlg-Organizer.png

You can sort the whole worksheet by a selected column (right-click and select Sort Worksheet) after importing data by CSV Data Connector.

Data Block Markers

If your file is a mix of data and non-data, you can define those characters which delineate data blocks:

  • Use the Start box to define the sequence of characters which mark the start of your data. If that sequence of characters uses section notation (i.e. is enclosed in square brackets as in [Data]), then End should be left blank.
  • When using section notation, make sure Main header lines = Auto.
  • Support for asterisk ("*") wildcard (e.g. "-*" will look for dash string of any length).
  • When a blank line marks the end of the data block, you can specify End = <blank>.

OriginHelp Data Block Marker.png

Excel

Excel import option dlg.png
  • For Excel files which have multiple sheets, specify an Excel Sheet to connect (you will have the chance to connect additional sheets after the connection is made.
  • If Main header lines are detected or specified, an additional Save file header to drop-down is added to the bottom of the dialog, with options to save the file header to the Worksheet label area or the Book organizer.
  • To manually specify the location of Column Labels, check the box and enter rows containing Long Names, Unit, Comments From and Comments To.
  • If your file contains multiple sheets, use the Data Navigator to connect to additional sheets, as needed.

JSON\MATLAB file

The Data Connector Browser dialog will open.

JSON DC dialog.png

The upper panel loads the structure of the imported file.

  1. Click on one branch to view the meta data in the right panel.
  2. Choose the desired branch and click the down arrow to add it to the lower panel.
  3. Click OK button to connect and import selected data.
  4. If your file contains multiple arrays, variables, etc., use the Data Navigator to connect to additional data, as needed.

Origin Project

Origin Connector imports data from an Origin project file. This allows you to use Origin project as a database to organize and store your data. From Origin 2020, the Origin Connector supports SQL query language for searching and extracting desired data.

Project DC dialog.png

  1. In the Select... dialog, click Select Query button Select Query button.png to open Select Query dialog.
  2. Enter query strings in the edit box to, for example, search in the entire project and pull all the columns with the specified LongName and plot designation.
  3. Clicking OK button will add the query to the lower panel. Click OK again to import columns that meets the condition to a new workbook.
  4. In addition to query capabilities, you can use the Data Navigator to connect to additional sheets in the Origin project, as needed.

HTML Table

The Data Connector Browser dialog will open.

Json DC dialog.png

The upper panel loads all the tables on the web page. Choose the desired table and click the down arrow to add it to the lower panel. Click OK button to import.

Import a File with Filter

  1. With a worksheet/matrix active, choose Data: Connect to File: Import Filter.
  2. Select a desired data file from the opened browser.
  3. In the Select Filter dialog, select the desired filter. Click OK to import.
Select filter dialog.png

Other types added by Add New Menu

Add New menu will open the App Center dialog with all published Data Connector Apps listed. Choose the desired Apps to add to the Data menu.

Click on the App title to open a web browser to File Exchange page to see the detailed documents of that App.

Or,

Manually open the File Exchange field on OriginLab website. On the Apply Filter panel on the left, check Data Connector checkbox under Refine by Category. This will filter all Data Connector Apps. Click on the desired App to download that App and see the detailed documents on its own page.