![](/profiles/wavemetrics/themes/wavemetrics/logo.png)
Loading waves from csv consist of random number of text and data
![](/sites/default/files/styles/thumbnail/public/default_images/Artboard%201_1.png?itok=jeHOCIXy)
linepic
I have a csv data file that contains various number of texts and data.
I tried to load it with every function in Igor, but I cannot pick it up.
can any experts suggest some way to load it?
I attach the example of my data.
Thanks you so much
To understand what it is doing, execute this:
and
To load the other information, if you want it, would require that you write a custom file loader. This would require a fair amount of Igor programming skill.
February 22, 2017 at 04:01 pm - Permalink
When you need to get the data in to Igor right away, the fastest method might be ...
* load the data file in to a spreadsheet
* copy the three columns of data to a separate worksheet by themselves
* export just that worksheet as a CSV file
* load the data in to Igor
You could also copy the worksheet directly in to a table in Igor. Or, you could import the spreadsheet directly in to Igor.
Someone here may eventually be willing to provide you with the Igor code for a basic file loader to get you started. Another option is to determine whether your instrument can export just the data without all the extra text stuff.
--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAH
February 22, 2017 at 07:29 pm - Permalink
February 23, 2017 at 01:06 am - Permalink
The loader reads the data first line by line to find a keyword (defined here as string constant "DataKey"), which separates header and data. The line number where this occurs can be used for the subsequent LoadWave command. Attached is also an example text file. You may be able to adjust this to your needs if you inspect the file and the code below.
February 23, 2017 at 01:07 am - Permalink
While data loading could certainly be simplified in Igor, this is not entirely true. From the Data menu, choose "Load Waves - Load Waves...". In the dialog, choose file type Delimited Text, and click Tweaks. For your specific file, you'll have to enter 215 for "Line containing column labels" and 216 for "First line containing data." That should load your data. It also prints out the actual command used in the history (the path will be specific to your computer):
February 23, 2017 at 08:04 am - Permalink
The 'information at the end of the file in a tabular form' can be loaded that way. The 'additional information about the experimental conditions' cannot be loaded directly into variables (into a text wave is possible though).
HJ
February 23, 2017 at 12:59 pm - Permalink
It is helpful to me a lot.
I start with the way you guys suggested.
I just loaded them by copy and paste, but the advanced method might be needed for the batch analysis.
Thanks for great help and will post the result.
February 23, 2017 at 03:20 pm - Permalink