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
 ASCII import data reduction
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

tinkusch

Germany
94 Posts

Posted - 04/09/2006 :  1:41:11 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 7.5 SR5
Operating System: XP German

Hi

when I want to import lenghty ascii files into a worksheet with the import assistant I have the option to skip every nth line in order to reduce the amount of data e.g. if the source file is very long (4000 rows or so im my case).

Is it possible to set this option with a Labtalk command?
I did not find a hint in the help files!

Thanks & bye

Stefan

Mike Buess

USA
3037 Posts

Posted - 04/09/2006 :  2:46:12 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Stefan,

The Import Wizard is controlled by Origin C and I don't believe there is a corresponding ASCII Import property. If you save an import filter from the IW you can change skip value in the filter using an Origin C function like the one below. The new skip value will then be used the next time you use the filter. (strFilter is the name of the filter file without the OIF extension and I've assumed that you saved the file to your User Files path.)

void Set_Skip_Value(string strFilter, int newSkip)
{
string strFile = GetAppPath() + "Filters\\" + strFilter + ".oif";
Tree trFilter(strFile,0);
trFilter.ASCIMP.iSkipRows.nVal = newSkip;
trFilter.Save(strFile);
}

Mike Buess
Origin WebRing Member
Go to Top of Page

tinkusch

Germany
94 Posts

Posted - 04/12/2006 :  4:12:59 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Mike,

thanks for your help. I decided to go an other way because I need to use an automatic routine, i.e. a Labtalk script. I just import the whole stuff and then work with the draft mode (Entwurfsmode) of the graphic display in order to reduce the amount of displayed datapoints. That does the job for the moment.
The ORIGIN people should, however, think of including a skip command into the ascii import features of LabTalk. That would be useful.

Thanks & bye

Stefan

Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 04/12/2006 :  5:39:34 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Stefan,

1) It is possible to import with filters from LabTalk although it will require help from Origin C. See this topic for an example...
http://www.originlab.com/forum/topic.asp?TOPIC_ID=3216

2) You can also decimate the full worksheet as explained here...
http://www.nmrtools.com/labtalk/i_decimate.html

Mike Buess
Origin WebRing Member
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