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
 Extract file number from the file name
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

eunakim@lg1

Korea
2 Posts

Posted - 02/11/2003 :  9:01:37 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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.

Mike Buess

USA
3037 Posts

Posted - 02/12/2003 :  07:56:09 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

eunakim@lg1

Korea
2 Posts

Posted - 02/12/2003 :  9:44:50 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks a lot!!

^_________^

Hun.
Go to Top of Page
  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