Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I need to rename some provinces to insert in a map.
What I've done so far is:
LOAD
PAESE,
REGIONE as REGIONE_SOURCE,
If(REGIONE = 'TRENTINO ALTO ADIGE', 'TRENTINO-ALTO ADIGE',
IF(REGIONE = 'EMILIA ROMAGNA', 'EMILIA-ROMAGNA', REGIONE)) as [REGIONE],
PROVINCIA as PROVINCIA_SOURCE,
if(PROVINCIA = 'PESARO URBINO', 'PESARO E URBINO',
if(PROVINCIA = 'CARBONIA IGLESIAS', 'SUD SARDEGNA',
if(PROVINCIA = 'MEDIO CAMPIDANO', 'SUD SARDEGNA',
if(PROVINCIA = 'MONZA BRIANZA', 'MONZA E DELLA BRIANZA', PROVINCIA))))) as [PROVINCIA]
...
One of them has an accented letter (Forlì Cesena). Does someone know how to manage it in the script?
I need to convert 'Forlì Cesena' into 'Forlì-Cesena'.
Thanks in advance.
I suggest that you changed your approach to a mapping:
- Marcus
Would you be so kind as to adapt to my script? I've no programming skills, it's a bit difficult for me to comprehend.
Thank u!
Maybe something like this:
m: mapping load * inline [
F1, F2
TRENTINO ALTO ADIGE, TRENTINO-ALTO ADIGE,
EMILIA ROMAGNA, EMILIA-ROMAGNA
];
LOAD
PAESE,
REGIONE as REGIONE_SOURCE,
applymap('m', REGIONE, REGIONE) as [REGIONE],
...
- Marcus
Thank you, I'm trying, but still facing issues with some provinces.
I'll figure it out!
Regards
If you load these mapping-data from a external source (file or db) and not per inline-load you shouldn't have trouble with these accent-chars. If really want to maintain this within the script you try to escape this char with a second one whereby this char isn't a pure accent else some kind of special-char …
- Marcus