| T O P I C R E V I E W |
| DeiMudda |
Posted - 06/06/2003 : 08:09:54 AM Hi,
is it possible to fill a text-label on a worksheet with informations from a text-file or ascii-file?
thx for help |
| 7 L A T E S T R E P L I E S (Newest First) |
| DeiMudda |
Posted - 06/06/2003 : 5:09:44 PM Also, a good idea. 
|
| Mike Buess |
Posted - 06/06/2003 : 3:50:59 PM Ah... open the file in a notes window and then copy to a label? Nice idea, but there's no LabTalk method that I'm aware of for copying the contents of the notes window. (It can be done in Origin C, but as you say that can only be used in Origin 7.)
Why not keep the information in the notes window? I think you can specify note window names even in Origin 5. You could add a button to the data worksheet that brings up the note window containing its information.
Mike Buess Origin WebRing Member |
| DeiMudda |
Posted - 06/06/2003 : 3:30:17 PM Mike: I tried your approach, but it didnīt work right. Could be my fault. ;)
By the way, is it possible to copy the content of a note window in the label? (open -n filename) -> ???? |
| Mike Buess |
Posted - 06/06/2003 : 12:38:21 PM If you have Origin Pro your best bet is with the UIM module suggested by Edgar. If you don't have Origin Pro a variation on my approach might still work. The string variable %Z can hold over 8000 characters, so you could import the information file to a second template with Header lines set to a large number. Then copy the label from that worksheet to the data worksheet. The whole thing could be automated in LabTalk.
Mike Buess Origin WebRing Member |
| DeiMudda |
Posted - 06/06/2003 : 10:13:48 AM wow,
thx for the quick responses, but..
the limit in text-size is a problem. I want to show additional informations e.g. boundary conditions to the data. Therefor i want to copy the full content of another txt/dat-file in the label. This informations are not in the same file as the data, but in the same folder (-> to get the path is not the problem.)
using OriginC commands would be nice, but the final project should work on Origin 5-7. On this account, i think thatīs not possible with OriginC.
thx for further help ;) |
| Mike Buess |
Posted - 06/06/2003 : 08:51:58 AM If the information is in a fixed-length file header you can try the following while a blank worksheet is active...
1> File->Import->ASCII Options. 2> In first line of File Header section enter the number of lines in the file header. 3> Click Update Options, then Cancel. 4> Tools->Worksheet Script. 5> Check Run Script Automatically after Import. 6> Enter the following LabTalk script...
label -s -sa Header %Z;
7> Click Update, then Cancel. 8> Click the Save Template button on standard toolbar to save your changes.
The header text should now show up in a text label called Header when you import, although it might be difficult to see against the background of the wks columns. Note - this works in Origin 7, but I'm not sure about earlier versions.
Mike Buess Origin WebRing Member
Edited by - Mike Buess on 06/06/2003 08:56:28 AM
Edited by - Mike Buess on 06/06/2003 08:57:48 AM |
| edgar.kaiser |
Posted - 06/06/2003 : 08:50:21 AM Hi,
you can import your text into a worksheet cell by the LabTalk OPEN command and then refer to that cell in your label text. That may be limited in text size.
Alternatively read your text file by an OriginC command (fread, fscanf, ...) and assign the result to your label.
If you have Origin professional use the UIM functions.
Several ways to do what you want. What the most convenient one is depends on your requirements.
Regards,
Edgar |