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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Import specific data from workbook
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

vertez

USA
5 Posts

Posted - 12/17/2012 :  1:05:59 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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;


  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000