From f95369b8384cf976414fb3809920e6d50257ed4d Mon Sep 17 00:00:00 2001 From: Michael Murtaugh Date: Tue, 14 Nov 2023 19:44:16 +0100 Subject: [PATCH] check for csvgrep --- pad-to-edit.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pad-to-edit.sh b/pad-to-edit.sh index dd687f6..17cad05 100644 --- a/pad-to-edit.sh +++ b/pad-to-edit.sh @@ -7,6 +7,14 @@ wget https://pad.xpub.nl/p/radioworm-20231107/export/txt -O radioworm-20231107.p python3 scripts/split-urls-csv.py < radioworm-20231107.pad.txt | \ python3 scripts/csv-add-end.py > radioworm-20231107.csv +# check if csvgrep is installed +if ! csvgrep --help &> /dev/null +then + echo "csvgrep could not be found, install csvtoolkit with pip or apt" + exit 1 +fi + + # Filter the CSV with a keyword csvgrep -c text -m "#intro" radioworm-20231107.csv > radioworm-20231107.intro.csv