Feb-17-2018, 07:04 PM
Thanks for reply Larz. I have a dataframe/table with 10,000 records. One of the fields is called LSOA name. Example as per below:
Crawley 999B
Leicester NBB99
Market Harborough ZZZ1
London 111V
What I want is just the place name, ie the text excluding the 4 character code (and the space) on the right. So the above would be:
Crawley
Leicester
Market Harborough
London
In sql I would use select "substr(['LSOA name'],1,len(['LSOA name'])-5) as LSOA_Area from..."
This means... take the field LSOA Name, take from the 1st character to the last character of the name minus 4 character from the right. So, "London 111V" loses the last 4 characters (and the spcase) and becomes "London".
Thanks
Andrew
Crawley 999B
Leicester NBB99
Market Harborough ZZZ1
London 111V
What I want is just the place name, ie the text excluding the 4 character code (and the space) on the right. So the above would be:
Crawley
Leicester
Market Harborough
London
In sql I would use select "substr(['LSOA name'],1,len(['LSOA name'])-5) as LSOA_Area from..."
This means... take the field LSOA Name, take from the 1st character to the last character of the name minus 4 character from the right. So, "London 111V" loses the last 4 characters (and the spcase) and becomes "London".
Thanks
Andrew