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 file number from the file 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
eunakim@lg1 Posted - 02/11/2003 : 9:01:37 PM
Hi everyone!!
I'm not sure this matter is new to this board but I don't know how to search the topic so I'm making new question.

I have a lot of ASCII files from other calculation S/W and I want to process the data using Labtalk. The x coodination value is in its file name like file1.din, file2.din, ... file102.din so on. The number in its file name has the information of x value of the result nd the file has the y value in ASCII form. So I need to extract the number from it file name and put it to the wks.

I use 'getfile -m' and 'open -w %a' to open the files.
The variable %a has the value like 'c:\data\........\file1.din'
how can I extract the file number from %a or is there any other marter way to do the same thing?

Any comment or advise will be helpful to me.
Thanks

Hun.
2   L A T E S T    R E P L I E S    (Newest First)
eunakim@lg1 Posted - 02/12/2003 : 9:44:50 PM
Thanks a lot!!

^_________^

Hun.
Mike Buess Posted - 02/12/2003 : 07:56:09 AM
Hi,

It should require only two steps...
%A=%[%A,>"\file" ]; // this leaves %A=xvalue.din
xvalue=%[%A,'.']; // strip the extension


Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 02/12/2003 08:13:55 AM

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