Newer
Older
Import / projects / LGN-IP3870 / qtpyui / sql-test / generate-test-data.sh
@John Ryland John Ryland on 22 Dec 2020 576 bytes import NUC files
#!/bin/bash

count=10000

if [ $# -gt 0 ]
then
    count=$1
fi

echo "About to generate $count phonebook records"
number=0
echo "making phonebook.txt..."
head -n $count /usr/share/dict/words |
while read line
do
    echo -e "$line\t0\t0\t$number\t\t\t\t\t\t/usr/local/lgvp/photos/snapshot/no_photo.png\t20000101054226005\t20000101054226"
    number=`expr $number + 1`
done > phonenumber.txt
echo "made phonebook.txt"
echo "making phonedb.db..."
python ./convert.py | sqlite3 phonedb.db
echo "made phonedb.db"
# echo "select * from phonedb;" | sqlite3 phonedb.db > /dev/null