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 specific data from workbook

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
vertez Posted - 12/17/2012 : 1:05:59 PM
Hi,
This is what I've just written:
pe_cd /; // Go to the top level
pe_mkdir "MagneticData"; // Create a folder
pe_cd "MagneticData"; // Navigate to that folder
getfilename *.dat;
win -t data n:=MagneticData;
open -w %A;
wks.name$ = Sheet1;

int nVal = range2uid([%H]);// get active page's UID
type "Before rename, active page is %H";
win -r %H Data;// rename it by prefxing with "Book1";

//5 T
// Define range using some of the columns
range rTemperature=1, rField=2;
type "Number of rows in raw data sheet= $(rTemperature.GetSize())";
// Define a condition string and extract data
// to a new named sheet in the same book
string strCond$="rTemperature >= 1.98 and rTemperature <= 301 and rField [i]$ =50000";
wxt test:=strCond$ ow:=[<new name:="5 T Magnetic">]"Sheet1"! num:=nExtRows;

This script is importing ASCII data, selecting specific data from it and putting it into new workbook called 5 T Magnetic. Ok. It works fine but not automatically. What if I have a lot of data in column named Field for example: 100, 1000, 2000 etc.?
It would be nice that the script will be scanning all columns and if it will find data like 100, 1000, 2000..., put them into new workbook, named maybe 100, 1000 and so go on, then, do some calculations in next column 4 like col(4)=col(3)*2 or using any kind of formula and then plotting data using for example: plotxy iy:=(3,4) plot:=201 ogl:=[<new template:=column.otp name:=100>];
Sum up:
1. For rTemperature scanning is always 1.98-301
2. For rField it would be good to scanning from 100-50000
I was thinking about looping but I have no idea how to do it.
Any help would be most welcome. #8195;



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