CSV question

I'm writing a program to create a CSV file that lists possible resistor matrix values. I might hand it off to other people to use. I don't use spreadsheets so don't know much about them.

I can do lines with numbers and strings and commas, but I'd like the spreadsheets to start with introductory comments. So, how does one format comments into a csv file?

Reply to
John Larkin
Loading thread data ...

If you mean comments in the sense that they're invisible to whatever opens the .csv, then I don't think it's possible.

Reply to
Clive Arthur

I assume the usual Microsoft thing, Excel or something, would be used. I've seen spreadsheets that start with a few introductory title lines. And some that actually label the columns that follow.

Most csv files are just heaps of numbers with no context, no revision control, no hint of author, date, or even what it is.

Reply to
John Larkin

What difficulty are you having? You can put anything into any cell, at least until you run into the many misinterpretations these programs make.

Reply to
Tabby

I guess I could stick some words into the normally numeric cells, but I have seen spreadsheets with nice title lines.

I suppose I can just generate a README.TXT file off to the side to document what the csv actually is.

So, I can't understand why so many people use spreadsheets. They are awful as controlled engineering documents. Apparently there is not even a standard for including comment lines.

Reply to
John Larkin

Just type the comments into the cells where you want them located. Then Merge the underlying (any cells covered by the comment) cells so only one cell is around the comment to make it tidier.

The math only acts on the cells you tell it to, so comments, headings, etc do not matter to the data.

John :-#)#

Reply to
John Robertson

I guess so. Seems primitive.

Reply to
John Larkin

It's a bit of a jungle - many things claim to generate or handle CSV.

In practice, one tests one's version against MS Excel, and a few non-MS databases or spreadsheets - whatever you are likely to encounter.

.<

formatting link
>

Joe Gwinn

Reply to
Joe Gwinn

If people are going to be reading the CSV file then just label each column at the top. You might want to keep an empty row or two between the title/label and the start of the column number values or, place the title/label on the left hand column of each row.

A good spreadsheet program should also allow you to import the data like you want it to be interpreted. Some programs are better than others I have found. Libre office and Excel "should" be able to allow you to format it like you want as it is being imported.

You can also have multiple sheets if you are converting to an .XLS type of file.

boB

Reply to
boB

On the NTFS file system, put the comments in an additional streams. Few application programs understand about streams.

Reply to
upsidedown

I just put the col headings as the first line in the CSV file. Libre office has no problem importing them. I can then use then as labels when graphing.

SQLite also will use them as the col heading for the table.

Reply to
Dennis

The guy is funny. It never dawned on me that any engineer would not understand spreadsheets. Even funnier, is the idea that anyone would consider them to be "primitive". I guess that goes hand in hand with thinking two pole active filters are "bizarre".

Reply to
Ricky

It's easy to put comments in . You just have to format the cell/row/column correctly.

Reply to
TTman

Why .csv? why not .xls etc ? IME .csv files always need post processing to get something usable/useful

Reply to
TTman

You're not quite understanding csv. You can put anything in your cells. Numbers, text, anything. CSV dates from 1972. Only plain text is more primitive.

If you use an associated file, you could name it samename_pad.txt

Reply to
Tabby

lørdag den 1. april 2023 kl. 18.38.04 UTC+2 skrev John Larkin:

if it is just a list, whats wrong with a text file?

spreadsheets are for doing calculations

Reply to
Lasse Langwadt Christensen

Certainly, but have you seen a csv with nice tittle lines?

Notice that what many organizations export as csv, like banks, are not actually csv files. Some are excel files, some are html files containing formatted tables.

For example:

"This is a title line" "description","unit price","amount","total price","comment" "pack of bolts",1.0€,1,1.00€,"" "pack of nuts",2.0€,1,2.00€,""

When opening the file, the user has to join the first line across several cells in order to make it a tittle.

Spreadsheets are a wonderful invention when used properly, as many other inventions. They go back to 1969.

formatting link
Reply to
Carlos E.R.

Many people use spreadsheets simply to format information. It's very easy to do and can produce a nice result with little effort. I produce my quotes, invoices, etc. using a spread sheet. There are some calculations, but just the sort of stuff you would see on any sort of simple invoice, multiply quantity by price, then sum all the individual items.

Mostly I am using it because of the various conditional formatting capabilities.

I use a spread sheet to track my travel. The only arithmetic is to track how many days I am in each area, entirely not essential, easily done by hand, but useful.

Reply to
Ricky

Not necessarily so. If the default formatting is left justified, the text can display across multiple cells without merging. It all depends on how "nice" you want it.

Reply to
Ricky

Right. Very few implementations of CSV have exactly the same interpretation of how to handle quoting, character sets, headings, white-space, etc. You just have to test the tools you plan to use, and find a common subset of CSV features.

Or just not use CSV.

CH

Reply to
Clifford Heath

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.