SMOLNET PORTAL home about changes

FZF script for searching a lookup table


DATE: 2020-06-15
AUTHOR: John L. Godlee


I have a very long lookup table which corrects synonymy in species names.

The table is a .csv with the original name in the first column and the corrected name in the second column.

I wrote a shell script which uses fzf to search the table and outputs the corrected name:

#!/usr/bin/env sh

csv=$(csvcut -c "${2}","${3}" "${1}" | sed 's/,/ -- /g' | tail -n +2)

echo "${csv}" | fzf | sed 's/.*--\ //'


fzf_csv test.csv orig corr
Response: 20 (Success), text/gemini
Original URLgemini://republic.circumlunar.space/users/johngodlee/post...
Status Code20 (Success)
Content-Typetext/gemini; charset=utf-8