-
Re: remove the fourth character from the end in a string
Alessandro Saccone Feb 12, 2013 3:10 AM (in response to Dimitris Charalampou)If your string has a variable lenght and the field name is for example myField you can use
=mid(myField,1,len(myField)-4)
-
Re: remove the fourth character from the end in a string
Dimitris Charalampou Feb 12, 2013 3:39 AM (in response to Alessandro Saccone )Hi there, thank you for your reply.
The field has a fixed length of 16 digits. Using the code that you gave me it completely removes the last four digits.
I just want yo remove the fourth from the last and keep the last three.
Thank you.
-
-
Re: remove the fourth character from the end in a string
Stefan Wühl Feb 12, 2013 3:37 AM (in response to Dimitris Charalampou)Look into the QV string functions section in the HELP file.
Your two expressions for the new fields might look like
LOAD
Number,
replace(Number,'******','*****') as NewNumber1,
left(Number,len(Number)-4)&right(Number,3) as NewNumber2,
...
Depending on the format of the Number field, you might also want to look into index(),findoneof() etc.
Regards,
Stefan
-
Re: remove the fourth character from the end in a string
Vishwaranjan Kumar Feb 12, 2013 3:58 AM (in response to Dimitris Charalampou)a:
LOAD * INLINE [
F1
123456******7890
];
load
replace(F1,'******','') as Number1,
replace(F1,'7','') as Number11,
left(F1,len(F1)-10) & right(F1,4) as Number2
Resident a;