Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I've the follwoing names in a column:
Lastname, firstname and in some cases
lastname, firstnameLastname, firstname,...
The following lastname ist joined to the previous firstname without a symbol. There is only a line break.
e.g.:
Miller, James
Smith, Marc
Flesher, JonasRabo, David
Jaris, Martha
Holder, SvenVeno, SusenStark, JulieZery, Claus
How can I separate the names in the script if there are several in one cell?
Have you tried Subfield:
LOAD SubField(Names, ',') as New_names
,*
INLINE [
Names
"jim, bill"
john
];
see attached file
File?
can't you see attach?
The problem is, who to separate the lastname (person 2) form a privious firstname (Person 1).
Flesher, JonasRabo, David
I need:
"Flesher, Jonas" separated from "Rabo, David"
This is what I can see:
Are you opening this from your inbox? You may need to be in a browser.
I'm using the Internet Explorer.
here is a better script:
Data:
LOAD * INLINE [
Names
"Miller, James"
"Smith, Marc"
"Flesher, JonasRabo, David"
"Jaris, Martha"
"Holder, SvenVeno, SusenStark, JulieZery, Claus"
];
// replace all letters with a pre | (pipe)
Data2:
load
replace(
replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(
Names,'A','|A'),'B','|B'),'C','|C'),'D','|D'),'E','|E'),'F','|F'),'G','|G'),'H','|H'),'I','|I'),'J','|J'),'K','|K'),'L','|L'),'M','|M'),'N','|N'),'O','|O'),'P','|P'),'Q','|Q'),'R','|R'),'S','|S'),'T','|T'),'U','|U'),'V','|V'),'W','|W'),'X','|X'),'Y','|Y'),'Z','|Z')
,' |',' ') as Name // but clean | when space is in front
resident Data;
Data3:
load
SubField(Name,'|') as AllNames // seperate values between pipes
resident Data2;
Dataclean:
NoConcatenate
load
AllNames
resident
Data3
where len(trim(AllNames)) > 0; // clean datas
drop table Data3;