- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In general the approach should work. Noticeable is that there are no spaces between the concat-parts which prevents in some scenarios the intended parsing. Therefore you could try it like:
... ' ' & Upper(cliente_rua_temp) ...
or alternatively:
... Upper(' ' & cliente_rua_temp) ...
Beside this is each replace-approach difficult to (practically) impossible if there is any overlapping between the replace-substrings and/or their position and frequency is not unique definable. Some tasks are solvable by applying the replace in multiple steps which are hierarchically ordered and are only applied on certain substrings.
But in more complex scenarios I would tend not to try to clean the entire string at ones else separating each sub-string per subfield(), maybe like:
load *, len/isnum/istext(Substring) as ...;
load *, subfield(String, ' ', iterno()) as Substring, recno() as RecNo, iterno() as IterNo
from Source while iterno() <= substringcount(String, ' ');
With the len/isnum/istext() + similar checks and IterNo the content of each substring could be identified and on it afterwards specialized replace/cleaning-logic applied. The final step would be to concatenate the substrings again to the complete string with the help of RecNo and IterNo.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, marcus. Thanks for the reply
It turns out to be something else that I was doing wrong. Using ' '&Upper(cliente_rua_temp) did the job after fixing it.
Still what you said is interesting, about separating the substrings. I actually do this at some part of the script, but this approach seems to be more efficient, I'll definitely try it and compare the results.
Thanks again!!