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 file through label control

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
OndrejM Posted - 06/06/2007 : 03:17:24 AM
Hi All,

I would need to make Controlled Label/Button which would load a file. Since I don’t have any programming background everything what I was able to do is just following:

1. I created a button
2. and to its label control I wrote: open –w c:\paht to the file

it works,… but a problem is that in my file the column' names are in 48th row,… so I would need somehow to specify that first 47 rows should be ignored and that column’ names should be read from 48 row. I also created filter by means of the "import wizard" but I don't know how to use it in label control.

if some of you have any suggest please let me know, everything can help

Thank you in advance
Ondrej
6   L A T E S T    R E P L I E S    (Newest First)
OndrejM Posted - 06/06/2007 : 11:40:01 PM
wow! it works great! that exactly what I need,...
thank you very much!

have a nice day/night (don't know what the time shift)

Ondrej
Mike Buess Posted - 06/06/2007 : 11:06:44 PM
OK, Data1 is always plotted in Graph1 and you just want to update Data1 from file. The following script avoids the necessity of restoring Data1 and minimizing it afterwards...

win -o Data1 {
ascimport.filename$="c:\VSSC\vssc.dat";
ascimport.headerlines=47; // ignore first 47 lines
ascimport.subheaderlines=0;
ascimport.renamecols=1; // take col names from line 48
ascimport.delimited=1;
ascimport.delimiter=0; // unknown delimiter
ascimport.import();
};
layer -a; // rescale Graph1

Mike Buess
Origin WebRing Member
OndrejM Posted - 06/06/2007 : 10:54:22 PM
Hi Mike,

I do modelling and the modelling program is alway rewriting one file e.g. c:\VSSC\vssc.dat,... since I need to visualize the results of the performed modelling I wound need to have a control button on pre-prepared graph window and just read new rewritten file and visualize results,… I’m not sure if you know what I mean,…

It is working now like this:

ascimport.filename$="c:\VSSC\vssc.dat";
ascimport.headerlines=47; // ignore first 47 lines
ascimport.subheaderlines=0;
ascimport.renamecols=1; // take col names from line 48
ascimport.delimited=1;
ascimport.delimiter=0; // unknown delimiter
win -a data1;
ascimport.import();
win -i data1;
win -z graph1;

I think now you can see what I want to do,… it works but I don’t know if this is the best way how to write it,.. because at the end of the script I’m minimalizing the worksheet (data1) and maximalizing the graph (graph1),… so it is doing such clicks on the screen I would prefer to somehow load the file (vssc.dat) on the background of the graph window and just see the results of my model,…

maybe I’m confusing you now,… sorry,…

anyway thank you very much I wouldn’t be able to do this without your help,…

Regards
Ondrej
Mike Buess Posted - 06/06/2007 : 10:20:03 PM
quote:
I’ve tried to add the following line to your script “window –a data1;” but it doesn’t work
As long as Data1 exists and you put "window -a data1" at the start of the label script there is no reason that should not work. You can also start the script with "window -t D;" to import to a new worksheet. But why would you want to do that from a graph window? I thought you wanted to put the button on a worksheet.

Mike Buess
Origin WebRing Member
OndrejM Posted - 06/06/2007 : 6:38:23 PM
Hello Mike,

Thank you very much for your extremely fast answer,… it works perfectly! I have only one small problem because I would like to import a file to not active worksheet,… e.g. I prefer to have label/button in a “Graph Window” and I want to import the file to worksheet,… so I’ve tried to add the following line to your script “window –a data1” but it doesn’t work I also tried to specified import like this “ascimport.import(data1)” but it also doesn’t work,…

Sorry bother you with such a stupid problem but I can’t solve it out,…

Anyway thank you very very much for your help

Regards
Ondrej
Mike Buess Posted - 06/06/2007 : 07:01:54 AM
Hi Ondrej,

Use this for your label control script...

ascimport.filename$="c:\path";
ascimport.headerlines=47; // ignore first 47 lines
ascimport.subheaderlines=0;
ascimport.renamecols=1; // take col names from line 48
ascimport.delimited=1;
ascimport.delimiter=0; // unknown delimiter
ascimport.import();

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 06/06/2007 09:57:51 AM

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