Calc: Remove footnotes from imported Wikimaterial

Assumes Text to strip is in cell A1. Converted text will appear in the cell in which this is pasted. Copy, paste special/text, to paste converted values.

=IF(ISNUMBER(FIND("[";A1));LEFT(TRIM(A1);FIND("[";A1)-1 );TRIM(A1))

" Kazakhstan[17] " will become "Kazakhstan"

" Bishkek " will become "Bishkek"

 

"Dushanbe" will remain "Dushanbe"