Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Community,
I have a country field with all small letters
Now the requirement is change it to only first letter should be in capital letter.
How can we achieve this requirement. I have tried with sub field function but no use.
Any suggestions please help
Thanks in advance!
Sample script where I am pulling data from wikipedia
FOR i = 1 to 23
Table:
LOAD Lower(PurgeChar([Country (exonym)], '[]0123456789')) as Country
FROM
(html, codepage is 1252, embedded labels, table is @$(i));
NEXT
FinalTable:
LOAD Country as Lower_Country,
Capitalize(Country) as Capitalized_Country,
Upper(Left(Country, 1)) & Right(Country, Len(Country) - 1) as First_Letter_Capitalized_Country
Resident Table;
DROP Table Table;
Output:
May be like this:
capitalize ('london') and it will return 'London'
Maybe the function
Capitalize(countryField)
What happens if it is two word country name like united states, would you want United States or United states?
If you want United States, then what has been proposed should work like a charm for you -> Capitalize(Country)
If(you wanted United states, then you can try this: Upper(Left(Country, 1)) & Right(Country, Len(Country) - 1)
Sample script where I am pulling data from wikipedia
FOR i = 1 to 23
Table:
LOAD Lower(PurgeChar([Country (exonym)], '[]0123456789')) as Country
FROM
(html, codepage is 1252, embedded labels, table is @$(i));
NEXT
FinalTable:
LOAD Country as Lower_Country,
Capitalize(Country) as Capitalized_Country,
Upper(Left(Country, 1)) & Right(Country, Len(Country) - 1) as First_Letter_Capitalized_Country
Resident Table;
DROP Table Table;
Output:
Thanks to everyone for your suggestions.!