without_json_allwork
This commit is contained in:
parent
20ed94482f
commit
20bd54dd3c
BIN
Parsing ZARAHOME/src/__pycache__/categories.cpython-313.pyc
Normal file
BIN
Parsing ZARAHOME/src/__pycache__/categories.cpython-313.pyc
Normal file
Binary file not shown.
@ -302,7 +302,7 @@ class Extractor:
|
|||||||
partnumber_val = size.get("partnumber", "")
|
partnumber_val = size.get("partnumber", "")
|
||||||
|
|
||||||
country = size.get("country") or ""
|
country = size.get("country") or ""
|
||||||
trace_local = f"Страна изготовления {country}" if country else trace
|
trace_local = f"Made in {country}" if country else trace
|
||||||
|
|
||||||
row = [
|
row = [
|
||||||
url_full,
|
url_full,
|
||||||
|
|||||||
0
Parsing ZARAHOME/src/records_folder/jhsdfgjshdf.pu
Normal file
0
Parsing ZARAHOME/src/records_folder/jhsdfgjshdf.pu
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
import pandas as pd
|
||||||
|
import os
|
||||||
|
|
||||||
|
# Укажите путь к папке, где находятся все файлы Excel
|
||||||
|
folder_path = '/Users/valis/Yandex.Disk.localized/Python3/Parsing ZARAHOME/src_2024-09-05/records_folder'
|
||||||
|
# Укажите путь и имя нового файла Excel, в который будут скопированы все строки
|
||||||
|
output_file = os.path.join(folder_path, 'Allfile.xlsx')
|
||||||
|
|
||||||
|
# Считываем все имена файлов в папке
|
||||||
|
files = [f for f in os.listdir(folder_path) if f.endswith('.xlsx') or f.endswith('.xls')]
|
||||||
|
|
||||||
|
# Флаг для определения, является ли текущий файл первым (для записи заголовков)
|
||||||
|
first_file = True
|
||||||
|
|
||||||
|
# Открываем файл Excel для записи
|
||||||
|
with pd.ExcelWriter(output_file, engine='openpyxl') as writer:
|
||||||
|
for file in files:
|
||||||
|
file_path = os.path.join(folder_path, file)
|
||||||
|
try:
|
||||||
|
df = pd.read_excel(file_path, engine='openpyxl')
|
||||||
|
|
||||||
|
# Если это первый файл, записываем с заголовками
|
||||||
|
if first_file:
|
||||||
|
df.to_excel(writer, index=False, sheet_name="Sheet", startrow=0, header=True)
|
||||||
|
first_file = False
|
||||||
|
else:
|
||||||
|
# Иначе записываем без заголовков, продолжая с последней строки
|
||||||
|
df.to_excel(writer, index=False, sheet_name="Sheet", startrow=writer.sheets["Sheet"].max_row, header=False)
|
||||||
|
except Exception as e:
|
||||||
|
print(f"Ошибка при обработке файла {file}: {e}")
|
||||||
Loading…
Reference in New Issue
Block a user