feat: add simple script to convert from tsv export.

This commit is contained in:
redxef 2025-03-10 19:29:11 +01:00
parent fe417c4438
commit 7ed8fd5182
Signed by: redxef
GPG key ID: 7DAC3AA211CBD921

22
fromtext.sh Executable file
View file

@ -0,0 +1,22 @@
#!/bin/sh
SEP='\t'
COLUMNS='4 5'
main() {
while read -r line; do
filename=
i=0
for c in $COLUMNS; do
f="$(echo "$line" | awk -F$SEP "{print \$$c}")"
[ -z "$f" ] && continue
if [ "$filename" = '' ]; then
filename="$(echo "$f" | tr '[:upper:]' '[:lower:]' | sed -e 's/ /-/g' -e 's/[^a-z0-9-]//g')"
fi
echo "$f" > "$filename.$i.md"
i=$((i+1))
done
done
}
main "$@"