給与管理システム新規作成
This commit is contained in:
20
backend/check_excel.py
Normal file
20
backend/check_excel.py
Normal file
@@ -0,0 +1,20 @@
|
||||
import xlrd
|
||||
|
||||
file_path = r"C:\workspace\njts-accounting-core\reports\tmp\01-07 (3).xls"
|
||||
workbook = xlrd.open_workbook(file_path)
|
||||
sheet = workbook.sheet_by_index(0)
|
||||
|
||||
print(f"シート名: {sheet.name}")
|
||||
print(f"行数: {sheet.nrows}, 列数: {sheet.ncols}")
|
||||
print("\n最初の15行:")
|
||||
print("=" * 100)
|
||||
|
||||
for row_idx in range(min(15, sheet.nrows)):
|
||||
row_values = []
|
||||
for col_idx in range(min(15, sheet.ncols)):
|
||||
cell_value = sheet.cell_value(row_idx, col_idx)
|
||||
if cell_value == '':
|
||||
row_values.append('')
|
||||
else:
|
||||
row_values.append(str(cell_value))
|
||||
print(f"行{row_idx}: {' | '.join(row_values)}")
|
||||
Reference in New Issue
Block a user