I've searched a lot of the existing posts, but still have not been able to find my answer. I'm trying to load a general text file that has 7 columns. I would like to append the file name to the column title. I know I need to use
LoadWave /D/G/W
which brings up the dialog box with all the column names in their proper place. But now how to I add the file name (minus .txt) and save?
Thanks!
Assuming that you don't want to use data folders and want to stick with your original idea . . .
This post shows how to get the file name before you call LoadWave and how to name a loaded wave using the file name.
If you know the names of the columns in the file in advance, you can extend this by extending the columnInfo variable:
If you don't know the column names in advance it gets more complicated. You have to write code to determine the column names from the file.
See the documentation for the LoadWave /B flag which allows you to programmatically specify wave names.
March 27, 2012 at 01:11 pm - Permalink
The above "should" rename the first wave loaded as the name of the file, assuming I didn't make mistakes. You can modify it from here to deal with the other 6 waves.
March 27, 2012 at 01:18 pm - Permalink
The LoadWave /B approach permits overwriting existing waves which may or may not be desirable.
March 27, 2012 at 03:19 pm - Permalink
Now that I have an automated loader for one file, I need to make a loop to load all files in a specified folder. If anyone has a link to a topic at their fingertips that already explains this, I would much appreciate it.
March 29, 2012 at 11:36 am - Permalink
Execute:
and read through the section entitled "Loading All of the Files in a Folder".
March 29, 2012 at 08:30 pm - Permalink
This might be of some help:
http://www.igorexchange.com/node/1720
April 3, 2012 at 08:06 am - Permalink