0
0

Openpyxl: コラムの削除

Posted at

プログラム

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
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0