The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Sort file list from GetFile
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

tom3m

USA
27 Posts

Posted - 02/21/2002 :  1:03:18 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
I have a script that is working quite well for plotting certain data sets and am now working on tuning a few finer details. One thing that has bugged me a bit is that if I use:

GetFile -m *.*;

to open a file chooser, then select a range of files in the usual windows way (pick one, shift click on second to choose range) and add those files to the list, the file names do not necessarily get put into the list in alphabetical order. For example, if I choose "file_A.txt", "file_B.txt", and "file_C.txt" the files might be put in order A-C-B instead of A-B-C. My guess is this has something to do with the Windows API and not Origin. Is there a way to sort the internal structure that Origin uses to store the file names so that when I read the files from this list one-by-one and operate on them, I can operate in alphabetical order?

I can import, operate on, and plot data from the files; it would just be nice to process the files in order since the plots that are generated are ordered in the same way as the data is read.

I just realized that another way to do this would be to sort pairs of column (X,Y columns) names before plotting. I'll have to look into that. It seems that sorting the file list would be easier and faster.

Thanks!

Mike Buess

USA
3037 Posts

Posted - 02/21/2002 :  1:26:21 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
If you are using Origin 6.1 you should try fdlog.MultiOpen() instead of getfile -m. You can choose which columns (filename, size, modification date, etc.) to show in the selection list and sort the files according to any of the columns. Files are imported in sorted order. Check out the fdlog object in Labtalk help for details.

Mike Buess
Origin WebRing Member
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000