Extracting String
Moderators: chulett, rschirm, roy
Extracting String
Hi
I am having a key column like
888888X
988888X
sgahjhasjk
737326X
I would like the output to be
888888
988888
sgahjhasjk
737326
ie only keys which end with X in input should not have that X in output
I am having a key column like
888888X
988888X
sgahjhasjk
737326X
I would like the output to be
888888
988888
sgahjhasjk
737326
ie only keys which end with X in input should not have that X in output
Pradeep Kumar
So... you want to remove an 'X' from the field in question? Anything more to it than that, like perhaps it needs to be the last character in the field?
If not, then a simple EReplace or Convert call to change it to an empty string (i.e. remove it) will do the trick.
If not, then a simple EReplace or Convert call to change it to an empty string (i.e. remove it) will do the trick.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Premium Member
- Posts: 1255
- Joined: Wed Feb 02, 2005 11:54 am
- Location: United States of America
I gave you the names of two functions that will work for you. How about you take a second and check the Help available for them and work it out? That's how one learns... much better than if someone just hands you a solution on a silver platter.
Give it a shot, if you still have problems come back.
Give it a shot, if you still have problems come back.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 70
- Joined: Thu Nov 09, 2006 2:14 am
Re: Extracting String
pradkumar wrote:Hi
I am having a key column like
888888X
988888X
sgahjhasjk
737326X
I would like the output to be
888888
988888
sgahjhasjk
737326
ie only keys which end with X in input should not have that X in output
hi ,
u can use if substrings(sttring name,len(string),length(string))='x' then
substring(string name,1,len(string)-1)) else input stringname.
Srini
-
- Participant
- Posts: 70
- Joined: Thu Nov 09, 2006 2:14 am
Re: Extracting String
pradkumar wrote:Hi
I am having a key column like
888888X
988888X
sgahjhasjk
737326X
I would like the output to be
888888
988888
sgahjhasjk
737326
ie only keys which end with X in input should not have that X in output
hi ,
u can use if substrings(sttring name,len(string),length(string))='x' then
substring(string name,1,len(string)-1)) else input stringname.
Srini
-
- Participant
- Posts: 147
- Joined: Sat Apr 30, 2005 1:23 am
- Location: Bangalore,India
Jeez, why make it more complicated than it needs to be when a simple solution has already been posted?
-or-
The OP hasn't mentioned anything that would require the solution be any more involved than that.
![Confused :?](./images/smilies/icon_confused.gif)
Code: Select all
Convert("X","",TheField)
-or-
Code: Select all
EReplace(TheField,"X","")
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers