Commit 6c51e11e authored by Luiza Wille's avatar Luiza Wille

Issue #64: Moved the functions to the top of the files.

Signed-off-by: Luiza Wille's avatarLuiza Wille <lmwc14@inf.ufpr.br>
parent 939919bf
......@@ -22,6 +22,30 @@ import sys, csv, json, math, subprocess
from pathlib import Path
from subprocess import call
def getDataFromRows(row1, row2):
newRow = []
for i in range(0, len(row2)):
if i in ignoreColumns2:
continue
newRow.append(row2[i])
for i in range(0, len(row1)):
if i in ignoreColumns1:
continue
newRow.append(row1[i])
return newRow
def getDataWithEmptyRow(columns, row):
newRow = []
for i in range(0, len(row)):
if i in ignoreColumns2:
continue
newRow.append(row[i])
for i in range(0, columns):
if i in ignoreColumns1:
continue
newRow.append('')
return newRow
if len(sys.argv) != 4:
print("Usage: " + sys.argv[0] + " <config.json> <filter> <columnId>")
sys.exit()
......@@ -67,30 +91,6 @@ title2 = csv_2.pop(0)
# Having data from both files, I have to merge them.
def getDataFromRows(row1, row2):
newRow = []
for i in range(0, len(row2)):
if i in ignoreColumns2:
continue
newRow.append(row2[i])
for i in range(0, len(row1)):
if i in ignoreColumns1:
continue
newRow.append(row1[i])
return newRow
def getDataWithEmptyRow(columns, row):
newRow = []
for i in range(0, len(row)):
if i in ignoreColumns2:
continue
newRow.append(row[i])
for i in range(0, columns):
if i in ignoreColumns1:
continue
newRow.append('')
return newRow
result = []
hits = 0
errors = 0
......
......@@ -22,6 +22,27 @@ import sys, csv, json, math, subprocess
from pathlib import Path
from subprocess import call
def getDataFromRows(row1, row2):
newRow = []
for value in row2:
newRow.append(value)
# Append columns ANO e MES.
newRow.append(row1[0])
newRow.append(row1[1])
# Start i in 5 because we want to ignore columns ID_SERVIDOR_PORTAL, CPF and NOME from Remuneracao.csv (we already have it from Cadastro.csv). We might not have data from them.
for i in range(5, len(row1)):
newRow.append(row1[i])
return newRow
def getDataWithEmptyRow(columns, row):
newRow = []
for value in row:
newRow.append(value)
# Append since 3 because we want to ignore columns ID_SERVIDOR_PORTAL, CPF and NOME from Remuneracao.csv (we already have this data from Cadastro.csv).
for i in range(3, columns):
newRow.append('')
return newRow
if len(sys.argv) != 4:
print("Usage: " + sys.argv[0] + " <config.json> <filter> <columnId>")
sys.exit()
......@@ -54,27 +75,6 @@ title2 = csv_2.pop(0)
# Having data from both files, I have to merge them.
def getDataFromRows(row1, row2):
newRow = []
for value in row2:
newRow.append(value)
# Append columns ANO e MES.
newRow.append(row1[0])
newRow.append(row1[1])
# Start i in 5 because we want to ignore columns ID_SERVIDOR_PORTAL, CPF and NOME from Remuneracao.csv (we already have it from Cadastro.csv). We might not have data from them.
for i in range(5, len(row1)):
newRow.append(row1[i])
return newRow
def getDataWithEmptyRow(columns, row):
newRow = []
for value in row:
newRow.append(value)
# Append since 3 because we want to ignore columns ID_SERVIDOR_PORTAL, CPF and NOME from Remuneracao.csv (we already have this data from Cadastro.csv).
for i in range(3, columns):
newRow.append('')
return newRow
result = []
hits = 0
errors = 0
......
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