lcn2 / calc

C-style arbitrary precision calculator
http://www.isthe.com/chongo/tech/comp/calc/index.html
Other
346 stars 52 forks source link

Enhancement: read/write csv #124

Closed ghost closed 10 months ago

ghost commented 11 months ago

Read/Write CSV.

lcn2 commented 11 months ago

What would be the purpose for writing CSV files? What should happen with a CSV file is read?

Can you give a usage case for CSV file reading and writing, and perhaps an example of why it would be useful for calc to read and write CSV files? For example, when calc reads a CSV file, what do you expect to happen?

UPDATE 1

We see that the person submitting this enhancement is no longer a valid GitHub user.

Anyone who might have an idea is welcome to try and answer our above questions.

lcn2 commented 11 months ago

Same as JSON, there are several open source packages. My Qt/C++/MyQueryIDE package exports SQL result sets as Excel files. The principal advantage is that the result set resides on one sheet while the generating SQL resides on another sheet. Some of these packages can also optionally generate CSV/TSV files.

Two can do the "Same as" @kcrossen :-)

Same as this comment in JSON.

In replying, try to focus on what you expect calc to do after reading a CSV file.

And to repeat:

Without a general use case to READ CSV and do something with what was read there isn't a good enough reason to justify the effort to integrate CSV with calc, let alone have a explanation of what calc should do with valid CSV that it has "read".

UPDATE 0

Hopefully the above will spur someone to try and answer the questions above. Should we receive replies, we would be happy to explore further.

UPDATE 1

Should we understand the CSV use case, we would be happy to consider adding CSV read/write support to the calc view TODO list.

We will leave this issue open thru the end of 2023 to see if we can understand the CSV use case.

lcn2 commented 11 months ago

Sorry that you, @kcrossen, found the above questions "harsh".

lcn2 commented 10 months ago

Would reading a CSV file into a 2D matrix, and writing a 2D matrix as a CSV file be useful?

Would writing an array (1D matrix) as a line into a CSV file be useful? Would reading a line from a CSV file into an array (1D matrix) be useful?

pmetzger commented 10 months ago

I can't think of why I'd really want this in my desk calculator.

lcn2 commented 10 months ago

I can't think of why I'd really want this in my desk calculator.

Fair point, @pmetzger.

While might be able to contrive an excuse for including it, there are more important things to consider for calc v3.