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
 Get column index from long name

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
Katti Posted - 09/19/2018 : 10:39:12 AM
Hi,

I'd like to get the column index of a column with a specified long name or short name. I.e. I want to search a sheet for the column what has long name "capacity" and return "E" or "5" if the long name of column E is "capacity". Any input on Labtalk commands that will let me do this?
4   L A T E S T    R E P L I E S    (Newest First)
Katti Posted - 10/17/2018 : 05:21:58 AM
quote:
Originally posted by minimax

Hi Katti,

Range syntax would be a useful way to get plenty of info from a specified Origin object, like following

range ra=[Book1]Sheet2!col("capacity");
ra.name$=; //short name
ra.index=; //index

rA.lname$=; //long name
rA.nRows=; //number of rows in the column
rA.unit$=; //text in Units label row
//etc.


See more introduction for Range in

https://www.originlab.com/doc/LabTalk/guide/Range-Notation




Hi Hideo,

Thanks a lot, it gets a lot easier with range notation. What I did was:

range ra="capacity" // ra represents column with long name "capacity"
ra.index=; // which lets me get the column index
ra.name=; // and column name

Thanks for the help :-)
minimax Posted - 10/11/2018 : 10:16:33 PM
Hi Katti,

Range syntax would be a useful way to get plenty of info from a specified Origin object, like following

range ra=[Book1]Sheet2!col("capacity");
ra.name$=; //short name
ra.index=; //index

rA.lname$=; //long name
rA.nRows=; //number of rows in the column
rA.unit$=; //text in Units label row
//etc.


See more introduction for Range in

https://www.originlab.com/doc/LabTalk/guide/Range-Notation
Katti Posted - 09/27/2018 : 10:18:55 AM
quote:
Originally posted by Hideo Fujii

Hi Katti,

How about like this?
token(nameof([Book1]!col("capacity"))$,2,'_')$=;
--Hideo Fujii



Yep, that works. Thanks
Hideo Fujii Posted - 09/19/2018 : 12:10:41 PM
Hi Katti,

How about like this?
token(nameof([Book1]!col("capacity"))$,2,'_')$=;
--Hideo Fujii

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