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
 Origin Forum
 How to extract useful information upon importing
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

tantiger

Singapore
41 Posts

Posted - 03/26/2002 :  02:19:56 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
I have a kind of ascii file to import to Origin.

However, when I tried to extract useful information out, it seems what I can do is to manipulate the %Z string till I found the information I want.
For example, the file is like this:
"------------------
DSC4
...
Sample Size: 4.2500 mg
....
___________________"

I wrote a script to check the letters in %Z till the "Sample Size:" is met, then take the 6 following ascii code to a variable.

Is there any easier method to get the sample size?

Another question is, how can I import another file in the data sheet without deleting the data it already contains?

Thanks a lot!

Edited by - tantiger on 03/26/2002 02:22:50

CStorey

Canada
137 Posts

Posted - 03/26/2002 :  11:42:40 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
There is a simpler way depending on the exact format of your data. I suggest you look at the documentation for "Substring Notation".

Here's an example.

type.redirection=1; // Display results in script window.

/// Create a dummy header in %Z
%Z=BC00_DBS.DAT
VC = Common
VB IB
;

%M=%[%Z, "="]; %M=; // Return everything to the left of the "=" sign

%M=%[%Z, >"="]; %M=; // Return everything to the right of the "=" sign

%A=%[%Z,@2]; %A=; // Return line #2 (@n returns the nth line)

In your case I believe either would work, depending on what the rest of the string looks like. Maybe use the @n trick to get to the right line, then search the line with %[%X, >":"] to get mass.

If you need more help just post a full header and we can be more specific.


Craig Storey
Origin WebRing Member - http://g.webring.com/hub?ring=originwebring
Go to Top of Page

tantiger

Singapore
41 Posts

Posted - 03/26/2002 :  9:33:35 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
CStorey,

Yes, your method works very well.

Thank you very much!

Except the method in LabTalk Forum, do you have other way to import the second file in the same data sheet? Because sometimes, after I have made a multi-import, I will realize one or two more files are needed. In other software, such as SigmaPlot, you can always import another file in the current data sheet without modifying the current sheet.
Go to Top of Page

CStorey

Canada
137 Posts

Posted - 03/27/2002 :  12:19:25 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Not sure I understand what your asking. Are you looking for a LabTalk solution to either:

1) Do you want to be able to import a file into a wks, then add another file as new columns?
2) Do you want to be able to import a file into a wks, then add another file as new rows?
3) Import multiple files into a single wks as new columns?

4) Import multiple files into a single wks as new rows?

All of these are possible. Let me know which if any of these is what you are looking for or give me an example of exactly what you want.





Craig Storey
Origin WebRing Member - http://g.webring.com/hub?ring=originwebring
Go to Top of Page

tantiger

Singapore
41 Posts

Posted - 03/27/2002 :  8:11:41 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I would like to import a new file as columns. However, other situations are also attractive .

I know there is a new functino in 6.1, which enables me to import them as new columns provided that I know exactly which files to be imported. But sometimes, I need to import another one as a new column, and there is no simple method for that in Origin, except copy and paste.

Hope the new version can do this.
I have studied your post in LabTalk forum, I think that can work in my situation.

Thank you very much .
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 03/27/2002 :  8:56:22 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I don't quite understand what you mean. You've been able to import as new columns for quite some time (at least back to Origin 6.0). In ASCII Options just select Import Into Worksheet as 'New Columns'.

...Of course you have to save the template to make it stick.

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 03/27/2002 21:01:33
Go to Top of Page

tantiger

Singapore
41 Posts

Posted - 03/27/2002 :  9:02:37 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Yes, you are quite right.

I didn't notice there is a partial import in the single file import window.

Thank you !
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