The Origin Forum
File Exchange
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 import ASCII File

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List

* Forum Code is ON
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

Check here to subscribe to this topic.

T O P I C    R E V I E W
sebbey Posted - 05/16/2012 : 08:40:39 AM
OriginPro 8.6.0G
Operating System: Windows 7 Professional

Hi everyone,

my LabTalk scripts run with a customized toolbar button. The first thing that happens after clicking on the button is this:

impAsc -d;

The ImportASC window pops up and I can select a file to import. If I choose more than one file to Import, all the files are imported into one workbook. Is there a way to import several files into several workbooks, without having to open several ImportASC windows. It would be perfect if I could click the button once, select all the files I need and import all these files in seperate workbooks.

And I have another question. Is it possible to somehow save the settings I need. Maybe within a LabTalk script. The script I'm currently working on will be used by many people who shouldn't be able to change any of these settings, in order for the script to work properly.

Thank you for your help,
2   L A T E S T    R E P L I E S    (Newest First)
sebbey Posted - 05/21/2012 : 02:38:33 AM
hi greg,

thanks for your answer. the script works perfectly and does exactly what i wanted!!

greg Posted - 05/16/2012 : 4:10:28 PM
Here is a basic script to import user-selected files into new workbooks:

// Prompt for files
dlgfile group:=ASCII multi:=1 init:=%Y; // %Y is your UFF
// Loop over all the files
// Get the next file
file$ = fname.GetToken(ii,CRLF)$;
impasc file$;
// If we are not done, add a new book
if(ii < fname.GetNumTokens(CRLF)) newbook;

There are many places script can be stored and run in Origin, but the two most common would be in a menu or a toolbar. For example, you can use the Custom Menu Organizer found under the Tools menu to add new menus with custom script.

The Origin Forum © 2008 Originlab Corporation Go To Top Of Page
Snitz Forums 2000