Commit 52c11c9f authored by Cristian Weiland's avatar Cristian Weiland

Issue #40: Rename indexes to group by year and month instead of university,...

Issue #40: Rename indexes to group by year and month instead of university, add prefix (MEC or MS) and add scripts to insert data from ministry of health.
Signed-off-by: Cristian Weiland's avatarCristian Weiland <cw14@inf.ufpr.br>
parent 3e3b41a8
......@@ -42,7 +42,7 @@ output {
user => "%(user)s"
password => "%(password)s"
hosts => "http://%(host)s:9200"
index => "%(index)s-%(university)s-%(date)s"
index => "%(index)s-%(date)s"
workers => 1
}
stdout {}
......
filter=("UNIVERSIDADE FEDERAL DO PARANA" "UNIVERSIDADE FEDERAL DE MINAS GERAIS" "UNIVERSIDADE FEDERAL DE SANTA CATARINA" "UNIVERSIDADE FEDERAL DE PERNAMBUCO" "UNIVERSIDADE FEDERAL DE SANTA MARIA")
university=("ufpr" "ufmg" "ufsc" "ufpe" "ufsm")
length=${#filter[@]}
for (( i=0; i<${length}; i++ ));
do
echo $i
echo ${filter[$i]}
echo ${university[$i]}
done
......@@ -42,7 +42,7 @@ output {
user => "%(user)s"
password => "%(password)s"
hosts => "http://%(host)s:9200"
index => "%(index)s-%(university)s-%(date)s"
index => "%(index)s-%(date)s"
workers => 1
}
stdout {}
......
......@@ -59,7 +59,7 @@ output {
user => "%(user)s"
password => "%(password)s"
hosts => "http://%(host)s:9200"
index => "%(index)s-%(university)s-%(date)s"
index => "%(index)s-%(date)s"
workers => 1
}
stdout {}
......
......@@ -37,8 +37,6 @@ file2 = params['path'] + params['date'] + params['file2']
idPointColumn1 = params['idColumn1']
idPointColumn2 = params['idColumn2']
print("Reading files...")
csv.register_dialect('dialect', lineterminator = params['lineterminator'], delimiter=params['delimiter'], quotechar=params['quotechar'])
with open(file1, newline='', encoding='Windows-1252') as f:
......@@ -103,9 +101,6 @@ for row2 in csv_2:
result.append(newRow)
errors += 1
#print("Number of rows in file 2 but not in file 1: " + str(errors))
print("Saving data...")
with open(params['outputFile'], 'w', newline='') as csvfile:
writer = csv.writer(csvfile, delimiter='\t')
writer.writerow(getDataFromRows(title1, title2))
......
......@@ -59,7 +59,7 @@ output {
user => "%(user)s"
password => "%(password)s"
hosts => "http://%(host)s:9200"
index => "%(index)s-%(university)s-%(date)s"
index => "%(index)s-%(date)s"
workers => 1
}
stdout {}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment