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
 Extract numbers from text

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
Thomas M Posted - 07/08/2005 : 03:41:05 AM
Origin Version (Select Help-->About Origin): 7.5pro
Operating System: W 98

Hi everybody,

I have a problem with some files. In one row there is a code wich looks as follows:

xxxx_1_15
xxxxxx_1_17
xx_1_19

The "x" stands for different numbers, with different length and wich are not of any interst for me. The "_1_15" stands for 15. January and thats what I want to have.
So, does anybody has a suggestion how to turn:


xxxx_1_15 to 15.01.
xxxxxx_1_17 to 17.01
xx_1_19 to 19.01.

by a script, cause I dont want to do it by hand for more than 200 rows.
2   L A T E S T    R E P L I E S    (Newest First)
Thomas M Posted - 07/11/2005 : 06:55:55 AM
Thank you! :)
Mike Buess Posted - 07/08/2005 : 06:58:13 AM
The problem is similar to finding the wks and column names of the dataset data1_B.

%A=xxx_1_15;
%A=%[%A,>'_']; // 1_15
%M=%[%A,'_']; // 1
if(%M<10) %M=0%M; // 01
%N=%[%A,>'_']; // 15
if(%N<10) %N=0%N;
%A=%N.%M; // 15.01
%A=;
15.01

...You can also use '_' as a token separator as follows.

%A=xxx_1_15;
%M=%[%A,#2,_]; // 2nd token (month)
if(%M<10) %M=0%M;
%N=%[%A,#3,_]; // 3rd token (day)
if(%N<10) %N=0%N;
%A=%N.%M;
%A=;
15.01

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 07/08/2005 09:38:09 AM

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