Version 1.0
-ajout d’un nouveau champ dans la table pour faire des recherches sans accent (bashbird et insert) -refonte de l’export markdown
This commit is contained in:
22
insert.sh
22
insert.sh
@@ -13,8 +13,8 @@ reset="\033[0m"
|
||||
dir=$(dirname "$0") # /Users/bruno/Documents/Scripts/keywords2insta
|
||||
|
||||
if [ ! -f ./birds.db ]; then
|
||||
cmd0="CREATE TABLE liste (Francais string, Autres string, Latin string, Anglais string, Ordre string, Famille string, Liens string);"
|
||||
echo "$cmd0" | sqlite3 ./birds_plus.db
|
||||
cmd0="CREATE TABLE liste (Francais string, Fra string, Autres string, Aut string, Latin string, Anglais string, Ordre string, Famille string, Liens string);"
|
||||
echo "$cmd0" | sqlite3 ./birds.db
|
||||
|
||||
if [ $? -ne 0 ]; then exit 0; fi
|
||||
fi
|
||||
@@ -34,20 +34,24 @@ if [ -f "$dir"/Oiseaux_europe.csv ]; then
|
||||
((skip_headers--))
|
||||
else
|
||||
fr="${array[0]}"
|
||||
aut="${array[1]}"
|
||||
lat="${array[2]}"
|
||||
en="${array[3]}"
|
||||
or="${array[4]}"
|
||||
fa="${array[5]}"
|
||||
ln="${array[6]}"
|
||||
fr_wa="${array[1]}"
|
||||
aut="${array[2]}"
|
||||
aut_wa="${array[3]}"
|
||||
lat="${array[4]}"
|
||||
en="${array[5]}"
|
||||
or="${array[6]}"
|
||||
fa="${array[7]}"
|
||||
ln="${array[8]}"
|
||||
|
||||
fr=$(echo "$fr" | sed "s/'/''/g")
|
||||
fr_wa=$(echo "$fr_wa" | sed "s/'/''/g")
|
||||
aut=$(echo "$aut" | sed "s/'/''/g")
|
||||
aut_wa=$(echo "$aut_wa" | sed "s/'/''/g")
|
||||
en=$(echo "$en" | sed "s/'/''/g")
|
||||
or=$(echo "$or" | sed "s/'/''/g")
|
||||
fa=$(echo "$fa" | sed "s/'/''/g")
|
||||
|
||||
cmd1="INSERT INTO liste (Francais, Autres, Latin, Anglais, Ordre, Famille, Liens) VALUES ('$fr','$aut','$lat','$en','$or','$fa','$ln');"
|
||||
cmd1="INSERT INTO liste (Francais, Fra, Autres, Aut, Latin, Anglais, Ordre, Famille, Liens) VALUES ('$fr','$fr_wa','$aut','$aut_wa','$lat','$en','$or','$fa','$ln');"
|
||||
echo "$cmd1" | sqlite3 ./birds.db
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user