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
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 import only part of an ascii file?

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

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
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
andrewdsto Posted - 07/06/2009 : 02:29:41 AM
Origin Ver. 8 sp 4 and Service Release (Select Help-->About Origin):
Operating System: win XP

Hi is there a way of importing, using scripting, only part of an ascii data file.

For example: I have ascii data files with two columns, the first contains time and the second contain pressure data. They may be long files containing millions of data points.

I may only want, say, the first 50,000 points. Can this be done easily within the importing script? Or more inportantly can I import data from the ascii file until say the time column reads 25 ms and then stop importing, rather than have to import a full seconds worth of data and then clip the record after it has loaded.

It would simply save time by not loading unwanted data in the first place. I understand this would mean actively monitoring data as it is loaded.

just wondering if and how it can be done?

thanks Andrew

2   L A T E S T    R E P L I E S    (Newest First)
andrewdsto Posted - 08/11/2009 : 9:06:25 PM
Thanks for your help Larry

cheers Andrew
larry_lan Posted - 07/06/2009 : 04:26:53 AM
Hi Andrew:

You can write something like
impasc	fname:="C:\Program Files\OriginLab\Origin8\Samples\Import and Export\ASCII Simple.dat"
		options.partimp.partial:=1
		options.partimp.lastrow:=10

where options.partimp.partial:=1 asks Origin to use partial import, and options.partimp.lastrow:=10 specifies the number of rows to be imported. More information, please read the impASC function of LabTalk help.

Regards to the second requirtment, what a pity that the Origin import wizard doesn't support "where" clause, so I am afraid you have to import all the data and extract what you want.

Thanks
Larry

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