h a l f b a k e r yCall Ambulance, Rebuild Kitchen.
add, search, annotate, link, view, overview, recent, by name, random
news, help, about, links, report a problem
browse anonymously,
or get an account
and write.
register,
|
|
|
Why not use the same parsing logic used for parsing
github
style tables as an alternative to CSV file format?
It means you can use comma! Plus such file format can
clearly and unambiguously tell you if it has a header cell
or not. We could also extend this to make it more
suitable for more
complex sheets. But only as long as it
keeps to the markdown ethos of easy human readability.
Could be baked into most apps as an alternative to CSV.
e.g.
```
# What is this?
no pipes here means it is just comments. Every row
needs to start with a "pipe" to be recognized as a start of
a table row. A header row is indicated by a sequence of
"|--|" just under the header row.
## Sheet Name 1
| Tables- | Are______ | Cool |
|----------|:-------------:|------:|
| col 1 is | leftaligned | $1600 |
| col 2 is | centered__ | $12 |
| col 3 is | right-aligned | $1 |
## Sheet Name 2
optional comments
| Tables- | Are______ | Cool |
|----------|:-------------:|------:|
| col 1 is | leftaligned | $1600 |
| col 2 is | centered__ | $12 |
| col 3 is | right-aligned | $1 |
```
------
But yea, if we really do think this is a good idea. We
really should create a standardization organization to
avoid the diverging implementation that affects CSV.
(Along with good instructions of implementing parsers.
Like how json was able to explain how it works
succinctly)
Bonus: Could we somehow also include formula support?
e.g. `=SUM(A5:B7)` without clashing with normal strings
and numbers? Maybe `| "43"="SUM(A5:B7)" |` to show
calculated value and the formula that was used?
Markdown Table Generator
http://www.tablesge...com/markdown_tables [mofosyne, Sep 09 2015]
CSV on the Web Working Group
http://www.w3.org/2...csvw/wiki/Main_Page [mofosyne, Sep 10 2015]
Side Thoughts: Promoting pipe tables as a potential alternative to .CSV format (e.g. .PSV ?)
http://talk.commonm...format-e-g-psv/1862 A post in commonmark discussion [mofosyne, Apr 23 2016]
Please log in.
If you're not logged in,
you can see what this page
looks like, but you will
not be able to add anything.
Destination URL.
E.g., https://www.coffee.com/
Description (displayed with the short name and URL.)
|
|
Windows regional settings allows choosing any character you like as a "list separator". It defaults to comma, but if you change it to pipe, Excel will use pipes as separators when sheets are saved as CSV. |
|
|
Also you can use commas in CSV, just "enclose, the, data, in quotes". Excel will do this automatically if the cells are properly formatted. |
|
|
How do you do you clearly define header rows? |
|
|
How do you specify multiple sheets? |
|
|
Or include the source behind a field? |
|
|
I think it would be good to add these specs in
clearly. |
|
|
The simplest way to do that would be to add a markdown format to Excel's "Save as..." dialog. All the things you just asked about could be formatted properly. |
|
|
When would someone need this? Beyond posting a reddit comment, what use would a markdown formatted spreadsheet be? |
|
|
I've used, and promoted the use of pipe (or where Lotus
notes is involved - tilde - pthew)
separated "character-separated-value" files for the last 15
years, and in the small niche area
I've worked, it's become the norm, along with a simple
headers row at the top. |
|
|
The reason has tended to be that we were too lazy to
write a proper parser, and this was the quickest, easiest
way to load data without screwing things up. |
|
|
That being said, there ought to be a nice, single data
standard that we could all gather around
that manages single and double-quotes, escaping
backslashes and all the usual stuff in a
single, simple and commonly accessible way that isn't
XML. |
|
|
I'm not so keen on this markdown flavoured version, since
if your tables are small enough to
be read by a human in markdown, they deserve being
presented in a pdf, html, tableau or
some other nice-to-read format - mixing the two can
make things tricky - though there are
precedents (perhaps) in mysql (and to some extent
oracle's sqlplus) which exports select
statements wrapped up in tabularising decorations like
this as default. |
|
|
Excel, apart from use as a kind of desk-calculator, is the
spawn of the devil and should be
hung-drawn and quartered and have its head displayed
atop a pike along London Bridge. |
|
|
So you would prefer a standard that implements just the
"markdown tables" aspect of consistent headers rows
recognition? (Thus removes all other other convenient
fluffs)? That would certainly keep it simple, and still get
the advantage of super simple parsing of header rows,
and data rows. |
|
|
Maybe there is a way to define the standard that allows
for
graceful failing? So you could implement the most basic
parser (one sheet, no comments), but then optionally
support a subset standard that supports the above plus a
bit
more. |
|
|
I could probably find the code I wrote to translate CSV to
PSV, if you want it. |
|
|
It was written in Turbo Pascal 3 when that was new. |
|
|
TSV (Tab-Separated Value) is a thing already. Does not that
work? |
|
|
ID F***K Name F***K Description
F***K F***K F***K F***K F***K
0 F***K Dog F***K Floppy Ears
1 F***K Cat F***K Owns humans
2 F***K Bird F***K Chirpy
|
|
|
I have just seen a database export that we think is from MS
SQL Server, and it's in the form of text files where the
values are separated by pipes. It's exactly like CSV or TSV,
but using pipes instead of commas or tabs; it's not like
Markdown. However, and I've never used MS SQL Server so I
don't know if this is normal, it appears to have two things
wrong: Every single character in the files is separated by a
space, and when we try to copy and paste anything out, all
we get is the first non-space character, so we can't even
paste the spaces into a Unicode inspector
|
|
|
Nasty; sounds like a job for a single-use software tool, and some
quality cursing time in front of a debugger. |
|
|
Would hatemail to the software provider help with crappy
data exports? |
|
|
//Every single character in the files is separated by a space// |
|
|
It might be encoded as UTF-16, which is popular on Windows, and
often looks a lot like this if you don't decode it correctly. |
|
|
I always read those encodings as "WTF-[whatever]". |
|
|
It was indeed UTF-16, as I discovered later. I might have
saved some time on that if I'd checked for suggestions here. |
|
| |