From 9c2f489be7af2c6198055effc07c4cdb6f3b9296 Mon Sep 17 00:00:00 2001 From: emkael Date: Sun, 21 Nov 2021 15:48:21 +0100 Subject: Checking either 2021 or 2022 paid status --- dumps/import-players.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'dumps/import-players.sh') diff --git a/dumps/import-players.sh b/dumps/import-players.sh index 3edb7c7..8996812 100755 --- a/dumps/import-players.sh +++ b/dumps/import-players.sh @@ -1,14 +1,13 @@ #!/bin/bash cd $(dirname $0) DBNAME=${LIGA_PLAYERS_DB_NAME} -curl ${LIGA_BAZA_CSV} | iconv -f cp1250 -t utf8 | grep '^[0-9]' | sed 's/;[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}/;T/g' | cut -d';' -f1-7,9,11 > baza.csv +curl ${LIGA_BAZA_CSV} | iconv -f cp1250 -t utf8 | grep '^[0-9]' | sed 's/;[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}/;T/g' | cut -d';' -f1-5,7,9-11 > baza.csv mysql ${LIGA_MYSQL_CONNECTION_OPTS} --local-infile=1 $DBNAME -e "TRUNCATE players; LOAD DATA LOCAL INFILE 'baza.csv' REPLACE INTO TABLE players FIELDS TERMINATED BY ';' ENCLOSED BY '\"' -(ID, gname, sname, rank, loc1, flag1, loc2, flag2, info); +(ID, gname, sname, rank, loc1, loc2, flag1, flag2, info); UPDATE players SET age = REPLACE(flag1, 'K', ''), sex = IF(POSITION('K' IN flag1), 'K', ''); -UPDATE players SET flag1 = NULL; " rm baza.csv -- cgit v1.2.3