Comments (6)
Hi @fonsecapeter ,
Thank you for interest in this small project!
About your suggestion, I think this is a bad idea, and here I will try to explain why.
-
The only widespread delimiter that can be quoted is comma. I have no proof of the statement, but I have never seen a quoted tab in tsv. Maybe practice of quoting semicolons also exist, but I've never seen such data tables. Also semicolons are rarely used as delimiters, so quoted semicolons must be even more exotic.
-
csv with escaped (or quoted) commas is a terrible format. I hope you can agree with this statement too. So the first thing an experienced user will do when he sees a quoted csv file, he will try to somehow convert it to tsv or json using some conversion tool. And here is where rainbow_csv will help - when highlighting is not working or looks broken for some lines in the file, it will encourage user to look more closely at the file they have, and after realizing it has escaped commas, quickly convert it to a more decent format (tsv or json or anything). So I can say that the broken highlighting is not a bug - it is a feature that helps to detect these awful files with escaped commas.
I am still open to the further discussion of this very interesting subject. A cool experiment IMO would be to crawl github with some smart web crawler and see what percentage of *.csv files have escaped commas.
from rainbow_csv.
Thanks @mechatroner,
You're totally right -- could always just reformat the file (which should usually happen anyway) and this could be a nice feature to make it super easy to spot before any other csv data loaders trip over it.
I was having some distant memories to using python3's builtin csv package, which can take a quote_char
and a delimiter
-- but I think that gets more into *sv territory instead of pure csv.
Might be interesting to see what kind of weird things are happening in github csv's/tsv's in general and in what proportions (could probably inform some kind of standardization too)... will let you know if I ever get around to doing something like that 😓
Anyway keep up the good work!
from rainbow_csv.
@fonsecapeter , I recently realized that quoted csv is more popular format than I thought. And I already wrote some code to implement escaped highlighting in "quoted_hl" branch. I will try to find any counterexamples that can break the new regexps, but if everything is OK it will be soon merged into master. Thank you very much for this suggestion, now I think that this is a Cool Idea =)
from rainbow_csv.
Awesome, thanks!
Just saw your new queries feature too, this is definitely the coolest way to work with spreadsheets in vim
from rainbow_csv.
csv highlighting is rfc-compliant now https://tools.ietf.org/html/rfc4180
from rainbow_csv.
Maybe I've closed this too early, because what I implemented is double quote escaping variant, but as you said there is also backslash quote escaping variant e.g.
this quote escaping works now:
12,"hello, ""world""!",100
and this doesn't:
12,"hello, \"world\"!",100
So, @fonsecapeter , if you still want to help, you can implement this quoting policy, we need both syntax rules and python, js and vim-script splitting functions.
from rainbow_csv.
Related Issues (20)
- Windows: Powershell and node (Python too?) cannot interact HOT 1
- Wijmo License Expired HOT 2
- View CSV columns in separate vim buffers in vertical splits
- Retain headers/column names in results HOT 7
- duplicate colors? HOT 2
- Failed to load Python host. HOT 3
- warning on comment lines are not ignored HOT 1
- modeline disables colors
- [bug] change colorscheme will make color disappear HOT 2
- [feature] Allow user customize hotkey
- rcsv_colorpairs hex
- Space leader key hijacked with rainbow key mappings disabled
- CSV tables that contain cells with newlines are not rendered properly HOT 4
- Image hosting issue HOT 2
- [bug] Error when source a non-exist syntax HOT 2
- How to keep the autodetection function and only apply to .csv and .tsv files? HOT 1
- Tips for dealing with inconsistent number of columns HOT 2
- g:rainbow_comment_prefix Not Honored HOT 1
- Should delimiter autodetect work in Neovim 0.8.1? HOT 4
- Multiline tabbed CSVs do not work.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rainbow_csv.