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 just 2 Files convert them and then the next

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
BrOsCoRe Posted - 07/05/2015 : 06:19:04 AM
Hi guys,
I got another question.

[Main]

win -cd %H;
newbook template:=test123 sheet:=1;
string path$;

path$ = "Y:\Daten\Anode\Komma";
findfiles ext:="s*.dat";
impAsc
options.Sparklines:=0
options.template:=test123;

@glob=1;
string iniwks$ = %H;

xyz_renka 3 20 20;
worksheet -p 242 FERTIG;
%T = %H;

doc -e w{
if(!(iniwks$==%H))
{
xyz_renka 3 20 20;
range rr = [%H]1!1;
win -a %T;
layer -i rr;
layer.Unit = 4;
}
}

@glob=0;

doc -e p{
expGraph filename:=%E
type:=jpg path:= "Y:\Daten\Bilder"
tr.Margin:=2
tr1.Unit:=2
tr1.Width:=1920
tr1.height:=1080
tr2.TIF.DotsPerInch:=800
tr2.TIF.Compression:=LZW;
}

doc -s;
run.section(auto1,Main);

So if i use the code like that there are 2 problems.
First is that if i import to files everithing works fine but if i open to new files he takes all allready importet files and put them together in on graph. But what i want is to import to Files put them into a graph and the import the next to files and put them into a new graph. That would be perfect if this could be kida loop.

My second problem is that i first want to import a file from path(example): "D:\DATA\FILE1\file1.dat"and i want to import a file from another path: "D:\DATA\FILE2\file1.dat"

is there any way to do this.

thanks for all the help.
Greetings
Bro
8   L A T E S T    R E P L I E S    (Newest First)
jasonzhao Posted - 07/06/2015 : 04:33:05 AM
Thanks, You can mentioned the Link of the Forum post in your email content:
http://www.originlab.com/forum/topic.asp?whichpage=1&TOPIC_ID=21077

so I will find the email fast.

Best regards!
Jason
OriginLab Technical Service
BrOsCoRe Posted - 07/06/2015 : 04:28:06 AM
Ok i will send it to as soon as i am at home.
So it will be in about 5-6 hours
jasonzhao Posted - 07/06/2015 : 04:24:34 AM
Hello,

You are right, before the code execute, the OPJ is an expty OPJ, but after the code execute, the OPJ contained data and graph. If you can send us the OPJ file (after executing script) to us to take a look,which should be intuitively, I think we can understand better to both the first and second questions in this post.

Best regards!
Jason
OriginLab Technical Service
BrOsCoRe Posted - 07/06/2015 : 04:12:56 AM
But isn't the code in an ogs file.
I don't understand why I should send you an empty opj.
jasonzhao Posted - 07/06/2015 : 04:02:12 AM
Hello,

The LabTalk Object StringArray which can save the string paths as array, you can refer to this page for further informations:
http://www.originlab.com/doc/LabTalk/ref/StringArray-obj

In fact, The operations execute by Script is always related to OPJ file, without OPJ file, it is difficult for us to debug this code, and get the results exactly you wanted

To show how to include string array in your code, sending the OPJ file to us (tech@originlab.com) to make a further test and debug is recommended.

Best regards!
Jason
OriginLab Technical Service
BrOsCoRe Posted - 07/06/2015 : 03:27:52 AM
I tried now to put this code into mine but it don't work

Could you pls show me how I need to include your code
BrOsCoRe Posted - 07/06/2015 : 01:50:04 AM
So at first thanks for the help with my second problem.
Ok i will explain it to you.x

If i am using this code it import now 2.dat files convert them and put them together in one graph. Then it exports the graph as jpg. OK fine.
But if i am gonna open the next to .dat files there are 4 opened at all in origin. So the code will take all the 4 files and put them together in one graph.
But what i like to have is that it import to files convert them, export them import next 2 files convert them and export them in a new graph. So that there are 2 files for one graph everytime.
I hope you undestand what i mean.

Greetings
Bro
jasonzhao Posted - 07/05/2015 : 10:26:23 PM
Hello,

For the second problem, you can pre-define the file path as a string array

StringArray path_s;
path_s.Add("D:\\");
path_s.Add("E:\\"); //add path a element of string array

then, get one StringArray element in your loop,remember to use the statement "ii++";

int ii=1;
string path$;	
path$ = path_s.GetAt(ii)$;
ii++;


For the first problem, I am not really understand "if i open to new files he takes all allready importet files and put them together in on graph", would you please make further interpretation or illustrate the problem with screenshot?

Best regards!
Jason
OriginLab Technical Service

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