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 ascii into new worksheet

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
Andreas_D Posted - 05/28/2010 : 10:22:55 AM
Origin Ver. and Service Release (Select Help-->About Origin): 8.0988
Operating System:WinXP Pro SP3

Hi everyone,

I'm trying to do some calculations on an active graph consisting of a fluorescence spectrum.
I would like to import some reference data from an ascii file into a new worksheet of the corresponding workbook, but when I run the following script:

workbook$=%[%C,'_'];
run -xf newsheet book:=workbook$ active:=1;
impASC fname:= system.path.program$+"File.dat";

the ascii file which consists of 5 columns is imported into the new worksheet but also in the original one, thus overwriting my spectral data.

How can I leave the original data untouched by the ascii import?

Any help is much appreciated.

Andreas
2   L A T E S T    R E P L I E S    (Newest First)
Andreas_D Posted - 05/28/2010 : 11:32:04 AM
Hi,

thanks for that, life is so simple when you just know...

Have a nice weekend,
Andreas
easwar Posted - 05/28/2010 : 10:56:13 AM
Hi Andreas,

As the graph window is still the active window, your import statement is importing data into the graph and replacing the original dataset. You can specify the 2nd sheet as the destination for the import such as:

impASC orng:= [workbook$]2! fname:= system.path.program$+"File.dat";

Then the data will only go into sheet2. And if you then want to graph that newly imported data into the same graph, you can use the plotxy X-Function to add the new data to the existing plot.

Easwar
OriginLab

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