Shorten contents of spreadsheet cellsPosted: 2020-08-05
I have a spreadsheet file with a list of species’ Latin names. I want to automatically create abbreviations for each species, by shortening both the genus and specific epithet to a certain number of characters. Here’s how to do it.
Let’s say I have these species:
Alligator_mississippiensis Anas_platyrhynchos Anolis_carolinensis Bison_bison Bos_taurus Callithrix_jacchus Camelus_bactrianus
When I paste them in Gnumeric, I select the underscore “_”, as a custom separator in the Text Import Configuration box. This places the two parts of the names into individual columns (“A” and “B”):
I want to take the first 3 characters of “A” and the first 4 characters of “B”, to make the abbreviation in column “C”, connected by an underscore. This is done in the following way, using the
Finally, to “restore” the two parts of the full latin name in a single column “D”, I used: