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
 Origin Forum
 Find maximum values with import labtalk script

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
ClemensObergfell Posted - 11/10/2014 : 09:47:38 AM
Origin Ver. and Service Release (Select Help-->About Origin): 9.0.0 G (32-Bit) SR1
Operating System: Windows 7 Corporate

Dear Origin Support Team,

What would be an easy solution to this task:
- I import several ASCII files into the workbook (like columns A to F in the picture)
- then I want to open a new column (column G, see in the picture)
- in this column there should be the maximum value of each "Kraft" column.

I want to write the labtalk script at the end of the import assistant where I already have the code to plot the data.

I would start with

worksheet -a 1

to open a new column, but then I have no idea to go on...

Thanks in advance for your help.

Greetings, Clemens
2   L A T E S T    R E P L I E S    (Newest First)
ClemensObergfell Posted - 11/11/2014 : 06:57:02 AM
Thank you so much!
It works fine, but only after I deleted the comments out of the script.
You helped me a lot. Thanks!

Edit:
I have now added integrations of the imported columns and wanted to get the max values of the "Integrated Y1" to "Integrated Y5" columns in the same style as before.

I have this script now but I don't get any values in the new column "Bruchenergie". What could I change to make it work?

wks.addcol();
wcol(wks.ncols)[L]$ = Max Werte;
row = 1;
loop(ii,1,wks.ncols-1)
{
str$ = wks.col$(ii).lname$;
if(str.Left(5)$==Kraft)
{
col(Max Werte)[row] = max(wcol(ii));
row++;
}
}
;
integ1 iy:=(Col(2), Col(1));
integ1 iy:=(Col(4), Col(3));
integ1 iy:=(Col(6), Col(5));
integ1 iy:=(Col(8), Col(7));
integ1 iy:=(Col(10), Col(9));
wks.addcol();
wcol(wks.ncols)[L]$ = Bruchenergie;
row = 1;
loop(ii,1,wks.ncols-1)
{
str$ = wks.col$(ii).lname$;
if(str.Left(5)$==Integrated Y)
{
col(Bruchenergie)[row] = max(wcol(ii));
row++;
}
}
plotxy iy:=((2,1),(4,3),(6,5),(8,7),(10,9)) plot:=202;

greg Posted - 11/10/2014 : 11:40:53 AM
// Add a column and set its Long Name
wks.addcol();
wcol(wks.ncols)[L]$ = Max Werte;
// Initial row for output
row = 1;
// Loop over all columns
loop(ii,1,wks.ncols-1)
{
// Get column Long Name
str$ = wks.col$(ii).lname$;
// Test if it's a 'Kraft' column
if(str.Left(5)$==Kraft)
{
col(Max Werte)[row] = max(wcol(ii));
row++;
}
}

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