Show all scripts

Import CSV spectra

Category: Data Import/Export
Description: This script imports CVS files as (multiple) spectra. It first analyzes the file for number of columns and rows of comma-separated values. If rows have different number of values, the highest number of values/row is assumed as normal and rows with less values are skipped. The script now analyzes the first row. If it contains non-numeric entries and the number of entries matches the value/row number, then the row is considered a header. Its entries are used as labels for the data-rows (or as unit for the calibration.) Once the number of columns is established, the first column is analyzed. If it gives a linear function in values, it is used as X-axis calibration. If it is not strictly linear, it is assumed to be just a further data column. Then, all data-columns are imported as individual slices in a LinePlot display.
Comments: To Import a CVS file as IMAGE (2D) simply use the File/Import functionality and choose the TEXTFILE option.
Script version: 1
DM/GMS version: 2.3.0
Script written as a function: No
Source: Show code
Download Source Code: Download