I need to format columns in a spreadsheet generated from CSV using
this format on the command line on a Mac:
_([$NAD] * #,##0.00_);_([$NAD] * (#,##0.00);_([$NAD] * "-"??_);_(@_)
On 2023-05-17, Dr Eberhard W Lisse <nospam@lisse.NA> wrote:
I need to format columns in a spreadsheet generated from CSV using
this format on the command line on a Mac:
_([$NAD] * #,##0.00_);_([$NAD] * (#,##0.00);_([$NAD] * "-"??_);_(@_)
A plain specification with input-output examples is better.
Not everyone knows what this formatting notation is.
On 2023-05-17, Dr Eberhard W Lisse <nospam@lisse.NA> wrote:
I need to format columns in a spreadsheet generated from CSV using
this format on the command line on a Mac:
_([$NAD] * #,##0.00_);_([$NAD] * (#,##0.00);_([$NAD] * "-"??_);_(@_)
A plain specification with input-output examples is better.
Not everyone knows what this formatting notation is.
If the OP wants to write to a spreadsheet from the command line, there's[...]
a Perl library specifically for writing XLSX:
No,
I want to (re-)format an existing spreadsheet. I.e. one that is
generated by a tool which can not format cells.
Neither do I more of less.
It seems to put NAD on the left of the cell and an amount on the
right. If the amount is 0 it des not put NAD in but a '-' sign.
But, I need to figure out how to cells in an existing spreadsheet
from the command line, never mind the actual formatting (for the
time being).
No,
I want to (re-)format an existing spreadsheet. I.e. one that is
generated by a tool which can not format cells.
On 2023-05-18, Dr Eberhard W Lisse <nospam@lisse.NA> wrote:[...]
I wonder if you could use the .XML file format that was used by
Excel 2003.
This is very simple, if we are to believe this Github repo: https://gist.github.com/ilyazub/2bced708865150b275b3
Such a thing could be generated from tabulated data by simple text processing.
An XLSX file is considerably more complicated. It's actually a ZIP
archive containing multiple files related together.
On Thu, 18 May 2023 15:35:25 -0400, Dr Eberhard W Lisse
<nospam@lisse.na> wrote:
No,
I want to (re-)format an existing spreadsheet. I.e. one that is
generated by a tool which can not format cells.
Include what program created the existing spreadsheet, what program will be using the output, enough lines from the existing spreadsheet to demonstrate the expected variety of input conditions, and the format lines.
Regards, Dave Hodgins
No,
I want to (re-)format an existing spreadsheet. I.e. one that is
generated by a tool which can not format cells.
el
On 18/05/2023 17:31, John-Paul Stewart wrote:
[...]
If the OP wants to write to a spreadsheet from the command[...]
line, there's a Perl library specifically for writing XLSX:
On Thu, 18 May 2023 21:35:25 +0200, Dr Eberhard W Lisse wrote:
No,
I want to (re-)format an existing spreadsheet. I.e. one that is
generated by a tool which can not format cells.
Based on those requirements, sounds easy enough to use a while loop to
read each line, use "set" command to parse each column into a variable followed by a print or echo statement to dump the variables in the desired order and separator.
For example the following set command will split columns at every comma.
#!/bin/bash
while read -r line; do
set -- $(IFS=',' ; echo $line)
col1=$1
col2=$2
col3=$3
echo $col3,$col1,$col2 >> new_fn_here
done < <(cat filename_for_input_here)
Suggested homework,
man set
On Thu, 18 May 2023 21:35:25 +0200, Dr Eberhard W Lisse wrote:
No,
I want to (re-)format an existing spreadsheet. I.e. one that is
generated by a tool which can not format cells.
Based on those requirements, sounds easy enough to use a while loop to
read each line, use "set" command to parse each column into a variable followed by a print or echo statement to dump the variables in the desired order and separator.
For example the following set command will split columns at every comma.
#!/bin/bash
while read -r line; do
set -- $(IFS=',' ; echo $line)
col1=$1
col2=$2
col3=$3
echo $col3,$col1,$col2 >> new_fn_here
done < <(cat filename_for_input_here)
Suggested homework,
man set
None of the below is going to assist in the issue of modifying a cell
format in an existing XLSX spreadsheet (never mind the format, for the
time being).
None of the below is going to assist in the issue of modifying a cell
format in an existing XLSX spreadsheet (never mind the format, for the
time being).
And of course the simple solution would be to use an awk-onliner for
that task instead of shell.
On 2023-05-19, Dr Eberhard W Lisse <nospam@lisse.NA> wrote:
None of the below is going to assist in the issue of modifying a cell
format in an existing XLSX spreadsheet (never mind the format, for the
time being).
I see; so your opening words:
"I need to format columns in a spreadsheet generated from CSV using
this format on the command line on a Mac:"
literally mean that you have a spreadsheet object which needs to be >manipulated, not that you have the CSV and are trying to generate
the spreadsheet with certain formatting.
I do not have Excel. And do not want to.
I generate the XLSX from the command line (using tools like QSV),
but that's beside the point.
I need to do this on/from the command line so it can be part of a
script.
I read the (non-)answers here as I am not the only one who does
not know how to do it.
On 19.05.2023 06:44, Bit Twister wrote:[...]
On Thu, 18 May 2023 21:35:25 +0200, Dr Eberhard W Lisse wrote:
No,
I want to (re-)format an existing spreadsheet. I.e. one that is
generated by a tool which can not format cells.
(There were already hints about using more appropriate newsgroups.)
I do not have Excel. And do not want to.
I generate the XLSX from the command line (using tools like QSV),
but that's beside the point.
On 2023-05-21, Dr Eberhard W Lisse <nospam@lisse.NA> wrote:
I do not have Excel. And do not want to.
I generate the XLSX from the command line (using tools like QSV),
but that's beside the point.
OK, since you have the XLSX generation down, what's preventing you from >manipulating the inputs to your tools, or their behavior. to get the
required format?
Cracking open the XLSX to fix it up seems like a circuitous route.
In article <20230521153007.658@kylheku.com>,
Kaz Kylheku <864-117-4973@kylheku.com> wrote:
On 2023-05-21, Dr Eberhard W Lisse <nospam@lisse.NA> wrote:
I do not have Excel. And do not want to.
I generate the XLSX from the command line (using tools like QSV),
but that's beside the point.
OK, since you have the XLSX generation down, what's preventing you from >>manipulating the inputs to your tools, or their behavior. to get the >>required format?
Cracking open the XLSX to fix it up seems like a circuitous route.
But, like it or not, that *is* what OP wants to do.
And, as that great sage Woody Allen has said, the heart wants what it
wants.
Cracking open the XLSX to fix it up seems like a circuitous route.
But, like it or not, that *is* what OP wants to do.
And, as that great sage Woody Allen has said, the heart wants what it
wants.
Wanting to crack the XLSX is half the fun. The other fun is making
a newsgroup full of fools guess about what it is one wants.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 422 |
Nodes: | 16 (2 / 14) |
Uptime: | 197:03:30 |
Calls: | 8,951 |
Calls today: | 2 |
Files: | 13,352 |
Messages: | 5,992,477 |