-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make bat autodetect CSV separator #1574
Comments
Thank you for your request. That would be great, I agree. I'm not sure if we can really "detect" the separator, but I guess we could write a syntax file that would accept all Another thing that I have been thinking about is to use a concept similar to https://packagecontrol.io/packages/rainbow_csv where we would display different CSV columns with different (or alternating) colors. Unfortunately, https://packagecontrol.io/packages/rainbow_csv does not seem to properly support quoting (such as |
Yep, that's certainly possible
I'm surprised at that, the screenshot in the readme of that package seems to suggest it handles quoted values. |
My mistake. It does. I only looked at the last lines of our test file previously: but that example is pretty challenging, if not to say... broken. The "rainbow" doesn't look too nice though. Not sure if we would have to make any changes to |
I guess some CSV parsers support newlines in quoted values (i.e. so it's not treated as a row-terminator), and double quotes to escape the quotation marks, so it could be considered not broken, just unusual - one shouldn't really use CSV in such cases IMHO ;)
Can you be more specific about what you don't like about it please? Does it look different in |
Mostly the colors. But that obviously depends on the theme. I don't like that the default (white) color is used. And that the dim comment color is used ("city"). Also, it would be great if the separator character would be highlighted in a different (consistent) way. |
Hi @sharkdp - bat doesn't seem autodetect the csv separator nor it does have any options to pass separator. Is there a possibility that bat will support this in future? It would be a great feature to have! |
See #2078 (comment). This will autodetect it in addition to allowing you to use a specific language tag for each variant |
@keith-hall - I've raised a PR #3115 which adds support for pipe delimiter for the CSV files. Could you please review it and let me know your comments/feedback..thanks! |
Hi,
CSV files often have a semicolon
;
as separator instead of a simple comma,
. There also exist so-called TSV files where the separator is a tabulation. Would it be possible forbat
to autodetect that ?The text was updated successfully, but these errors were encountered: