Check file extensions in folder
This commit is contained in:
@@ -100,12 +100,16 @@ csvFileNames = []
|
|||||||
if os.path.isdir(csvPath):
|
if os.path.isdir(csvPath):
|
||||||
folder = csvPath
|
folder = csvPath
|
||||||
print(f'Fájlok a mappában: {os.listdir(csvPath)}')
|
print(f'Fájlok a mappában: {os.listdir(csvPath)}')
|
||||||
for i, file in enumerate(os.listdir(csvPath)):
|
files = os.listdir(csvPath)
|
||||||
|
for file in os.listdir(csvPath):
|
||||||
|
if not os.path.splitext(file)[1] == '.csv':
|
||||||
|
files.remove(file)
|
||||||
|
print(f'Csv fájlok a mappában: {files}')
|
||||||
|
for i, file in enumerate(files):
|
||||||
csvFileNames.append(file)
|
csvFileNames.append(file)
|
||||||
with open(os.path.join(csvPath, file), newline='') as csvfile:
|
with open(os.path.join(csvPath, file), newline='') as csvfile:
|
||||||
incsv = csv.reader(csvfile, delimiter=';')
|
incsv = csv.reader(csvfile, delimiter=';')
|
||||||
csvArrs.append([])
|
csvArrs.append([])
|
||||||
|
|
||||||
for row in incsv:
|
for row in incsv:
|
||||||
csvArrs[i].append(row)
|
csvArrs[i].append(row)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user