Is it possible to use @replace string function with a wildcard? If not, does anyone have an idea how to do what I'm trying to do?
I am trying to strip off the path information so I have just the Eviews workfile name.
%wfpath = "C:\work\Eviews\q2fy10_sys.wf1"
%wf = @replace(%wfpath,"*\","")
I would expect replacement to remove all characters up to and including the last backslash so that %wf is equal to q2fy10_sys.wf1
Does not seem to work...
TIA
Using @replace with wildcard
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Using @replace with wildcard
No, it doesn't work that way (nor could it, logically).
If you know that your path has 3 slashes in it, then you can use @instr and @mid to do what you want:
If you know that your path has 3 slashes in it, then you can use @instr and @mid to do what you want:
Code: Select all
%wfpath = "C:\work\Eviews\q2fy10_sys.wf1"
%wf = @mid(%wfpath, @instr(%wfpath, "\", 3)+1)
Re: Using @replace with wildcard
Last edited by monjoride on Mon Jul 14, 2014 7:00 am, edited 3 times in total.
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Using @replace with wildcard
Code: Select all
%wfpath = "C:\work\Eviews\q2fy10_sys.wf1"
%wf = %wfpath
!pos = @instr(%wf, "\")
while !pos>0
%wf = @mid(%wf, !pos+1)
!pos = @instr(%wf, "\")
wend
Re: Using @replace with wildcard
Hey...
Nice link shared...
Its a great site for getting the information...
Thank you for sharing this great informative stuff here...
_______________
basement dehumidifier
Nice link shared...
Its a great site for getting the information...
Thank you for sharing this great informative stuff here...
_______________
basement dehumidifier
Last edited by Gardner on Sat Apr 28, 2012 5:00 am, edited 1 time in total.
Who is online
Users browsing this forum: No registered users and 0 guests
