プログラム
delete_columns.py
#! /usr/bin/python
# ---------------------------------------------------------------
# delete_columns.py
#
# Aug/06/2024
# ---------------------------------------------------------------
import sys
import openpyxl
#
# ---------------------------------------------------------------
xlsx_in=sys.argv[1]
#
sys.stderr.write("xlsx_in = %s\n" % xlsx_in)
wb = openpyxl.load_workbook(filename=xlsx_in)
ws = wb.worksheets[0]
#
ws.delete_cols(29,5)
ws.delete_cols(23,5)
ws.delete_cols(17,5)
#
wb.save(xlsx_in)
# ---------------------------------------------------------------
実行コマンド
./delete_columns.py in01.xlsx