added readings index up to L-1144

This commit is contained in:
2021-01-28 13:49:56 +01:00
parent 080a9d2733
commit 6b7f65cc58
2 changed files with 169 additions and 5 deletions

View File

@ -1,14 +1,22 @@
#!/bin/zsh
printf "start at reading no. L-"
read -r start_no
#!/bin/bash
if [ -n "$1" ]; then
printf "start at reading no. L-"
read -r start_no
else
start_no="$(tail -n1 readings_index | cut -f3)"
fi
for ((n=$start_no;n<=4000;n++)); do
printf "index of reading no. L-%s:" "$n"
read -r index
if [ "$index" -gt 2200 ]; then
if [ "$index" = "" ]; then
continue
elif [ "$index" -gt 2200 ]; then
echo "Kanji from third book. Just adding index and reading index for now"
printf '%s\t\t%s\n' "$index" "$n" | tee -ai readings_index
else
elif [ "$index" -gt 0 ]; then
line="$(grep -P "^$index\t" lesungen)"
printf '%s\t%s\n' "$line" "$n" | tee -ai readings_index
elif [ "$index" -eq 0 ]; then
n="$(( n - 2 ))";
fi
done