v 0.7
This commit is contained in:
BIN
Oiseaux europe.xlsm
Normal file
BIN
Oiseaux europe.xlsm
Normal file
Binary file not shown.
2080
Oiseaux_europe.csv
2080
Oiseaux_europe.csv
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
23
bashbirds.sh
23
bashbirds.sh
@@ -1,6 +1,16 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
VERSION="v0.6b"
|
||||
VERSION="v0.7"
|
||||
|
||||
red="\033[1;31m"
|
||||
greenbold="\033[1;32m"
|
||||
green="\033[0;32m"
|
||||
yellow="\033[0;33m"
|
||||
yellowbold="\033[1;33m"
|
||||
bold="\033[1m"
|
||||
#bold_under="\033[1;4m"
|
||||
underline="\033[4m"
|
||||
reset="\033[0m"
|
||||
|
||||
dotenv () {
|
||||
set -a
|
||||
@@ -27,16 +37,7 @@ ScriptWorkDir="$(dirname "$ScriptPath")" # /Users/bruno/Documents/Scripts/bashbi
|
||||
LatestRelease="$(curl -s -r 0-50 $RawUrl | sed -n "/VERSION/s/VERSION=//p" | tr -d '"')"
|
||||
LatestChanges="$(curl -s -r 0-200 $RawUrl | sed -n "/ChangeNotes/s/### ChangeNotes: //p")"
|
||||
echo $LatestRelease
|
||||
echo $VERSION
|
||||
|
||||
red="\033[1;31m"
|
||||
greenbold="\033[1;32m"
|
||||
green="\033[0;32m"
|
||||
yellow="\033[0;33m"
|
||||
bold="\033[1m"
|
||||
#bold_under="\033[1;4m"
|
||||
underline="\033[4m"
|
||||
reset="\033[0m"
|
||||
echo -e "${yellowbold}Bashbird${reset} $VERSION\n"
|
||||
|
||||
|
||||
req2() {
|
||||
|
||||
12
insert.sh
12
insert.sh
@@ -12,7 +12,7 @@ reset="\033[0m"
|
||||
|
||||
dir=$(dirname "$0") # /Users/bruno/Documents/Scripts/keywords2insta
|
||||
|
||||
if [ ! -f ./birds_plus.db ]; then
|
||||
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
|
||||
|
||||
@@ -21,11 +21,11 @@ fi
|
||||
|
||||
array=()
|
||||
|
||||
if [ -f "$dir"/Oiseaux_europe_plus.csv ]; then
|
||||
if [ -f "$dir"/Oiseaux_europe.csv ]; then
|
||||
|
||||
# export Excel : CSV UTF-8 (délimité par des virgules)
|
||||
|
||||
echo -e "Insertion des données du fichier .csv dans la base birds_plus.db...\n"
|
||||
echo -e "Insertion des données du fichier .csv dans la base birds.db...\n"
|
||||
|
||||
skip_headers=1
|
||||
while IFS=';' read -ra array;
|
||||
@@ -48,10 +48,10 @@ if [ -f "$dir"/Oiseaux_europe_plus.csv ]; then
|
||||
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');"
|
||||
echo "$cmd1" | sqlite3 ./birds_plus.db
|
||||
echo "$cmd1" | sqlite3 ./birds.db
|
||||
fi
|
||||
|
||||
done < <(grep "" "$dir"/Oiseaux_europe_plus.csv) # lit la dernière ligne même si elle n'est pas vide
|
||||
done < <(grep "" "$dir"/Oiseaux_europe.csv) # lit la dernière ligne même si elle n'est pas vide
|
||||
|
||||
else
|
||||
echo -e "${red}No .csv file found !${reset}"
|
||||
@@ -60,5 +60,5 @@ fi
|
||||
|
||||
|
||||
query="SELECT * FROM liste;"
|
||||
result=$(sqlite3 ./birds_plus.db "$query")
|
||||
result=$(sqlite3 ./birds.db "$query")
|
||||
echo "$result"
|
||||
|
||||
Reference in New Issue
Block a user