How to format XLSX cells? #983
-
I have to generate a really messed up XLSX file for monthly upload to the Revenue Service (Employee's Tax). It has 81 columns, a header row, and a row for each employee, but that is not the issue. It also uses an extremely weird format for the cells (columns) containing amounts.
I would like to be able to format the cells containing amounts (ie columns) using the (any) format string which Excel shows when you look at the cell format, which in our case is the above. Currently I am investigating a combination of perl Excel Reader/Writer modules. I this something having been considered by someone before and perhaps someone already has a solution? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @ondohotola , To your query, we do have the Though it uses the What you may want to do is add either Python's f-string expressions are particularly powerful and easy to use. Luau's string interpolation feature can also be leveraged for this issue. |
Beta Was this translation helpful? Give feedback.
Hi @ondohotola ,
First off, I moved your query to Discussions so other people who may have the same question can more easily find it in the future.
To your query, we do have the
to xlsx
subcommand, but that doesn't handle your current situation.Though it uses the
xlsxwriter
crate that does support specifying both formats and formulas, I think its out of scope for theto
command.What you may want to do is add either
luau
orpy
to your pipeline and implement the format there, before converting the CSV to xlsx.Python's f-string expressions are particularly powerful and easy to use.
Luau's string interpolation feature can also be leveraged for this issue.