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
 import ascii into new worksheet
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Andreas_D

Germany
11 Posts

Posted - 05/28/2010 :  10:22:55 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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

easwar

USA
1964 Posts

Posted - 05/28/2010 :  10:56:13 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

Andreas_D

Germany
11 Posts

Posted - 05/28/2010 :  11:32:04 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

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

Have a nice weekend,
Andreas
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