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 URL | gemini://republic.circumlunar.space/users/johngodlee/post... |
|---|---|
| Status Code | 20 (Success) |
| Content-Type | text/gemini; charset=utf-8 |