Haneef Puttur

How to Clean up names and split names in Excel as First , Middle and Last Name

Scenario :

You have a excel file with one column which is full name. It needs to clean up by trimming extra spaces, convert into sentense case and finally split into three names .

Example :

Orginal Name : MAHAMMAD HanEEF BALLeri PUttur    = > Firstname : Mahammad  Middlename : Haneef Balleri  Lastname : Puttur

Steps

Download the sample excel file here :sample_haneef

Splitting Full Name into First , Middle and Last name in Oracle Pl/SQL

If you wish to achieve the same in oracle use the following trick>

 

–Firstname

select substr (‘Mohammed Hannef Marakkar Puttur’,1,instr(‘Mohammed Hannef Marakkar Puttur’,’ ‘)) from dual;

— Last Name

select substr (‘Mohammed Hannef Marakkar Puttur’,instr(‘Mohammed Hannef Marakkar Puttur’,’ ‘,-1)) from dual;

–Middle Name

select substr(substr (‘Mohammed Hannef Marakkar Puttur’,1,instr(‘Mohammed Hannef Marakkar Puttur’,’ ‘,-1)),instr(‘Mohammed Hannef Marakkar Puttur’,’ ‘)) from dual

 

 

Exit mobile version