💾 Archived View for republic.circumlunar.space › users › johngodlee › posts › 2020-06-15-fzf_csv.gmi captured on 2023-09-28 at 16:20:33. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2021-12-04)

-=-=-=-=-=-=-

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