6.10 Exporting Worksheets and MatricesExport-Wks-Mat
Origin worksheet data can be exported as the following five formats: ASCII, Excel, NI TDM (TDM, TDMS), Sound (WAV), ESRI shapefile (SHP). And Origin worksheet can be exported as one-page PDF file, multi-page PDF file or image file.
Origin matrix data can be exported as the following two formats: ASCII and Image.
Exporting worksheet data as ASCII file
The ASCII export is limited to data-only worksheets. Complex documents containing embedded information, such as report sheets, worksheets with embedded or linked graphs (including sparklines), cannot be fully exported to ASCII files. If the worksheet data to be exported has embedded images and graphs, those images and graphs will be ignored during exporting.
To export worksheet data as an ASCII file:
- With the worksheet active, select Origin main menu File: Export: ASCII... to bring up the expASC dialog box.
- Specify the options for file type, path, separator, header, etc. in the dialog and click the OK button.
Key options for exporting worksheet data as ASCII file:
- Support DAT, TXT and CSV file types. If CSV is selected, quotes are inserted, as needed, to protect cell contents.
- Support export of selected data only. Note that selections may be non-contiguous.
- Support a user-specified data separators (not available for the CSV file type).
- Support export of header information.
- Support full numeric precision and missing values.
Notes:
- Beginning with Origin 2018, hidden worksheet columns are not exported, by default. If you wish to include hidden columns when exporting, open the Script Window (Window: Script Window) and set @UHC = 1. This changes the export behavior within the current Origin session only. To make this change permanent, see FAQ-708 How do I permanently change the value of an "@" system variable?
- Since Origin 2018b, the ending empty columns can be excluded when export the worksheet data, by check the Ignore Ending Empty Columns check box under the Options branch. Then, the export will ignore all empty columns after the last column with data, meta data not considered, and column with all missing values are considered empty.
|
| The expASC dialog File Path drop-down lists a <Project Folder><PE Path> option for data export. Currently, however, this requires a scripted solution because the dialog box takes only one worksheet as input.
|
Exporting worksheet/workbook as Excel file
To export current workbook or specified worksheet(s) as an Excel file:
Y* selecting File: Export: Excel... menu from the activated workbook and then checking Show Options Dialog box
Or
The expXLS dialog as below will be opened:
- Exported file name and path support substitution notation. Select from File Name and File Path drop-down list for frequently-used file name like
<long name> and path like <Project Folder><PE Path> . It is useful for batch exporting.
- Use Export Sheets to specify Whole Book or Active Sheet Only.
- When exporting the whole book, exclude selected sheets by right-clicking on the sheet tab and choosing Exclude from Excel Export. Analysis report sheets are automatically skipped.
- To export worksheet formatting, check the Export Cell Formats box. Note that not all of Origin's format settings can be interpreted by Excel (e.g. significant digits, column designations) but such things as font/font size, cell fill color and decimal digits, should be kept.
Exporting worksheet/workbook as an SQLite file
To export one sheet or all sheets in the workbook, as an SQLite file:
- Activate the worksheet and click File: Export: SQLite. Alternately, open the Script Window (Window: Script Window), type the following and press Enter:
expSQLite -d
This opens the expSQLite dialog box.
- Choose a File Extension. Note that the file structure and content will be the same regardless of chosen file type.
- To export all sheets in the book to a single file, check the All Sheets box.
For more information, see this Origin blog post.
Exporting worksheet data as National Instruments TDM file
Export worksheet data as National Instrument TDM file. This exportation is limited to data-only worksheets.
To export worksheet data as National Instruments TDM file:
- With the worksheet active, select File: Export: NI TDM (TDM, TDMS)... from the Origin main menu to bring up the expNITDM dialog box.
- Specify the file name and other options in the dialog. Then click the OK button.
Exporting worksheet data as Microsoft PCM wave file
To export worksheet data as Microsoft PCM wave file:
- With the worksheet active, select File: Export: Sound (WAV)... from the Origin main menu to bring up the expWAV dialog box.
- Specify the parameters in the dialog and click the OK button.
Key options for exporting worksheet data as wave file:
- Support two channel modes: Mono and Stereo.
- Support left channel and right channel when channel mode is Stereo.
- Support partial exportation.
To specify the sampling intervals in the exported WAV file, you need to:
- Highlight the desired column, right click to bring up the context menu.
- Select Set Sampling Intervals to set the sampling intervals for this column.
- Export the worksheet data, and the sampling interval is stored in the WAV file.
To specify the quantization bit length, you need to:
- Highlight the column and select Format:Columns from top menu.
- Under the Options branch, set the Format as Numeric.
- Change the Data Type according to the following table to get the desired bit length:
Data Type
|
Bit Length
|
Long(4)
|
32-bit
|
Short(2)
|
16-bit
|
Byte(1)
|
8-bit
|
Exporting worksheet data as ESRI Shapefile
To export worksheet data as ESRI Shapefile:
- With the worksheet active, select File: Export: ESRI Shapefile (SHP)... from the Origin main menu to bring up the expSHP dialog box.
- Specify the parameters in the dialog. There are two kinds of Data Layout supported.
Single XY Coordinates
|
At lease 3 columns are required. The first 2 columns are XY coordinates and the 3rd column is Index (converted to integers if double, and must in increasing order). Rest of columns (if any) are meta data.
|
Multiple XY Coordinates
|
XY coordinates are in multiple pairs of columns (if the number of columns in the worksheet is odd, each pair of columns will be exported as XY pair and the last column will be ignored). Meta data is in label rows.
|
- Click the OK button.
Exporting worksheets as Multipage PDF file
Worksheets, including those that contain images or embedded/linked graphs, can be exported as PDF files.
Notes:
You can export the worksheet or result sheet as either a one-page or multi-page PDF file.
|
Export worksheet as a multi-page PDF file:
- With the worksheet active, select File: Export: As Multipage PDF File... from the Origin main menu to bring up the Export Worksheet As Multipage PDF File dialog box.
- Specify the exporting worksheet(s), file name, path and other settings. And then click the OK button.
Key options for exporting worksheet as multi-page PDF file:
- Support multi-worksheet exportation. Each worksheet will be exported as one PDF file.
- Support user-defined PDF settings, such as color translation, line mode, fill mode, data compression, fonts, cover page, etc..
- Support user-defined page settings, such as grids, header, footer, background color, frame, margin, etc..
|
Exporting worksheet as image file
Those worksheets containing images or embedded/linked graphs but not Origin report sheets, can be exported as an image file. The image types include: AI, BMP, CGM, DXF, EMF, EPS, GIF, JPG, PCX, PDF, PNG, PSD, TGA, TIF, WMF.
To export worksheet as image file:
- With the worksheet active, select File: Export: As Image File... from the Origin main menu to bring up the expWks dialog box.
- Specify the exporting worksheet(s), file name, path and other settings. And then click the OK button.
Key options for exporting worksheet as image file:
- Support multiple worksheets exportation. Each worksheet is exported as one image.
- Provide export settings such as export area, image size, etc..
Exporting worksheet as PDF File
To export worksheet as a PDF file:
- With the worksheet active, select File: Export: As PDF File... from the Origin main menu to bring up the expWks dialog box. Image Type is set as Portable Document Format (*.pdf).
- Specify the exporting worksheet(s), file name, path and other settings. And then click the OK button.
Exporting worksheet graphs using Export Graphs
To export workbook-contained graphs (floating, cell-inserted, graphs added as sheets) as image files:
- Choose File: Export: Export Graphs. This opens the Export Graphs dialog box.
- Use Select Graph(s) to choose which graphs to export or choose Specified and use the browse button to the right of the Graph Page box to choose graphs for export. Note that to export embedded graphs, including graphs added to books as sheets, you can choose All in Active Folder (include Embedded).
- Set other options as needed, including your export path and click OK.
A couple of things to note:
- You cannot export graphs inserted into worksheet cells as image files (i.e. if you cannot double-click on a graph and pop open an editable graph, then the graph is inserted as an image).
- File Name(s) for graphs added to the workbook as sheets will refer to the sheet name. Note that your sheets may not have a <long name>.
Exporting matrix data as ASCII file
The data stored in a matrix object can be exported as an ASCII file.
To export matrix data as ASCII file:
- With the matrix active, select File: Export: ASCII... from the Origin main menu to bring up the expMatASC dialog box.
- Specify the options for file type, path, separator, etc. in the dialog and click the OK button.
Key options for exporting matrix data as ASCII file:
- Support DAT, TXT and CSV file types. If CSV is selected, quotes are inserted, as needed, to protect cell contents.
- Support user-specified data separators (not available for the CSV file type).
- Support full numeric precision, missing values and XY coordinates.
Exporting matrix object as image file
The matrix object of any data type can be exported as an image file. The data type might be converted to another data type according to the settings. The image types are including BMP, GIF, JPG, PCX, PNG, PSD, TGA and TIF.
To export matrix object as image file:
- With the matrix active, select File: Export: Image... from the Origin main menu to bring up the expImage dialog box.
- Specify the image type, name, DPI resolution, color depth, etc.. And then click the OK button.
| From Origin 2024, when export matrix window as image, it supports to include the graph objects.
A system variable @UPM can be used to control this:
@UPM=1; //export matrix including the graph objects
@UPM=0; //export matrix excluding the graph objects
|
|