On Sun, Jan 16, 2022 at 1:01 AM Jack Woehr via MIDRANGE-L
<midrange-l@xxxxxxxxxxxxxxxxxx> wrote:
IBM isn't kidding when it tells you open source is the path forward.
https://openpyxl.readthedocs.io/en/stable/
That package is what I consider to be in a sweet spot, balancing
between level of abstraction (and thus ease of use) and fine-grained
control.
But if you want to tilt as far to abstract and easy as possible (which
I think is appropriate if CPYFRMIMPF has been your workhorse), then
you want to look at pandas.
You'll need to install Python and pandas if you haven't already. These
you would do with yum, either at a PASE shell or via the ACS GUI.
Once you have those, the code you have to write is close to minimal:
import pandas
pandas.read_excel('myworkbook.xlsx').to_csv('mytabfile.csv', sep='\t')
(That isn't tested, and I don't personally use pandas.)
If the "chained method" style is too uncomfortable for you, or if you
have very long stream file names, you may want to break it up into
simpler, shorter lines. For example, you could do
import pandas
excelfile = 'my_long_excel_workbook_path_here.xlsx'
tabfile = 'my_long_tab_delimited_path_here.csv'
mydata = pandas.read_excel(excelfile)
mydata.to_csv(tabfile, sep='\t')
John Y.
As an Amazon Associate we earn from qualifying purchases.