Newby question: Change full name to initials only

249 views
Skip to first unread message

Adele van der Merwe

unread,
Oct 20, 2016, 5:34:34 AM10/20/16
to OpenRefine
My datasheet contains the full name(s) [column]. How do I change this to initials only? 

Adele van der Merwe

unread,
Oct 20, 2016, 8:23:54 AM10/20/16
to OpenRefine
Solved it by using the split column option (1,20) and creating two columns. Is there a better way?

Owen Stephens

unread,
Oct 20, 2016, 8:31:09 AM10/20/16
to OpenRefine
I'd suggest using the 'split' function to split the names into individual words, you can then use 'forEach' to iterate over the list of words and extract the first initial. So e.g.:

forEach(value.split(" "),v,v[0]).join("")

Owen

Adele van der Merwe

unread,
Oct 20, 2016, 9:15:56 AM10/20/16
to openr...@googlegroups.com
Thanks! Can't wait to try that when I get the updated list containing all the names. My original spreadsheet only provided the first name. 

--
You received this message because you are subscribed to a topic in the Google Groups "OpenRefine" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openrefine/8_8S9wPXz_U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openrefine+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages