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
 Extracting data from worksheet using longnames

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
HaroldPit Posted - 11/22/2011 : 11:35:48 AM
Origin Ver. and Service Release (Select Help-->About Origin): Origin Pro 8.5.0G SR1
Operating System: WINXP

Hi everyone,

I'm looking for a way to extract columns whose longnames are equal to an alphanumeric input (like "abc12") from a worksheet. Is there a way to make wkx search through the longnames and only extract those columns that I specified?

Background: I have worksheets that have up to 100 datasets that each consist of up to 10 different subdatasets. Each of the 100 datasets has the same 10 subdatasets as columns "abc12" def34" "ghi78" and so on. I want to create a worksheet by extracting only columns with a longname "abc12". Is that possible? In the end they will be XYZconverted and then converted into a Matrix for 3D plotting.
2   L A T E S T    R E P L I E S    (Newest First)
HaroldPit Posted - 11/24/2011 : 11:11:02 AM
Thank you Sam,

In the meantime I circumvented this problem by importing my data into discrete worksheets where all the columns are identical from worksheet to worksheet. But your code will come in handy for a similar problem I have.
Sam Fang Posted - 11/23/2011 : 06:01:42 AM
You can try following script.
---------------------------

int nc=wks.ncols;
%A=page.name$;
%B=page.active$;
newbook;
jj=1;
for(ii=1; ii<=nc; ii++)
{
string str$=[%A]%B!col($(ii))[L]$;
 if (str.CompareNoCase("abc12")==0)
 {
   range ra=[%A]%B!col($(ii));
   col($(jj))=ra;
   jj++;
  }
}

------------------------------------

Sam
OriginLab Technical Services

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