Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Are keepchar & purgechar case sensitive? For example, if I want to purge all occurrences of the letter E (both upper and lower case), would I need to say purgechar(FIELD1,'Ee') as NEW_FIELD
Yes PurgeChar and KeepChar are case sensitive.
You need to write...
PurgeChar(FIELD,'Ee') as NEW_FIELD
Hi,
1 example:
PurgeChar(FIELD,'0123456789$*-@#&') AS FIELD_CLEAR,
KeepChar(FIELD_CODE,'0123456789') AS CODE_CLEAR;
LOAD * Inline
[
FIELD, FIELD_CODE
Jhons09&5, 0001DSFJHDS
Alf$*--15, 0002SDFSSDS
Don@#$, DFDSFSDR0003DSFJHDS
Mich0123456789, DFGDFRG0004DSFJHDS
];
escese me:
LOAD *,
PurgeChar(FIELD,'0123456789$*-@#&') AS FIELD_CLEAR,
KeepChar(FIELD_CODE,'0123456789') AS CODE_CLEAR;
LOAD * Inline
[
FIELD, FIELD_CODE
Jhons09&5, 0001DSFJHDS
Alf$*--15, 0002SDFSSDS
Don@#$, DFDSFSDR0003DSFJHDS
Mich0123456789, DFGDFRG0004DSFJHDS
];
Or you can do this:
PurgeChar(Upper(FIELD1),'E')
or
PurgeChar(Lower(FIELD1),'e')
Sunny, wouldn't this potentially change also the case of characters one may want to keep?
Yes it would ...
But at times that might be acceptable. In times it is not, I would use Manish's script
afaik almost all qv functions are case sensitive
Thanks much.