cleaner data sets
This commit is contained in:
parent
8241967ab6
commit
9b89d7d7b0
28
scripts/concatFiles.py
Normal file
28
scripts/concatFiles.py
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
import os
|
||||||
|
import json
|
||||||
|
|
||||||
|
# Directory path
|
||||||
|
directory = './'
|
||||||
|
|
||||||
|
# Output file path
|
||||||
|
output_file = './concat.js'
|
||||||
|
|
||||||
|
# List to store JSON data
|
||||||
|
json_data = []
|
||||||
|
|
||||||
|
# Iterate over files in the directory
|
||||||
|
for filename in os.listdir(directory):
|
||||||
|
if filename.endswith('.json'):
|
||||||
|
file_path = os.path.join(directory, filename)
|
||||||
|
try:
|
||||||
|
with open(file_path, 'r') as file:
|
||||||
|
data = json.load(file)
|
||||||
|
if data.get('type') == 'spell':
|
||||||
|
json_data.append(data)
|
||||||
|
except Exception as e:
|
||||||
|
print(f"Error reading file {file_path}: {str(e)}")
|
||||||
|
|
||||||
|
# Write the concatenated JSON data to the output file
|
||||||
|
with open(output_file, 'w') as file:
|
||||||
|
json.dump(json_data, file)
|
||||||
|
|
||||||
16124
src/data/dataFiltered.js
Normal file
16124
src/data/dataFiltered.js
Normal file
File diff suppressed because one or more lines are too long
17892
src/data/dataSorted.js
Normal file
17892
src/data/dataSorted.js
Normal file
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user