Ignoring comment lines
See original GitHub issueHello,
Thank you for providing a useful extension, which improves my productivity. This is related to #13. In Python world, I’m regularly working with CSV-like files containing multiple comment (header) lines as below.
# 1st comment line
# 2nd comment line
# 3rd comment line
# :
# next line is the beginning of CSV data...
column_label1,column_label2,column_label3
data1,data2,data3
:
:
It will be nice if I can ignore (and see in one color) those comment lines with additional options like:
"rainbow_csv.ignore_comment_line": true,
"rainbow_csv.comment_line_regexp": ^[#].*
Thank you and best regards, Kazzz
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:15 (8 by maintainers)
Top Results From Across the Web
Python: How to ignore #comment lines when reading in a file
Use regex re.compile("^(?:\s+)*#|(?:\s+)") to skip the new lines and comments.
Read more >Remove or ignore all comment lines from Linux config files
In this tutorial, we show several methods you can use to remove all comment lines from a file via the Linux command line....
Read more >Ignoring comments in lines when parsing - MATLAB Answers
Ignoring comments in lines when parsing . Learn more about programming, trim, text, regexp, comments.
Read more >opencsv / Feature Requests / #139 Ignoring comment lines
Hello, Would it be possible to add support for ignoring comment lines(line starting with "#") same as ignoring empty lines?
Read more >git diff: ignore comments - Unix & Linux Stack Exchange
so far, it works as expected. git diff -G'^[^#]' does not show the comment as change. But if I add a real change...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Timmmm, I can! And I actually already implemented this in the “rfc” branch along with many other changes. I am planning to publish a new version in about 2 weeks.
@lucky-wolf You can check if it is working or not by hovering your cursor over the comment line: instead of the column info it will show “Comment” or something like this. Setting Comment_prefix also allows Rainbow CSV to efficiently run separator autodetection, affects Align/Shrink and Multi-cursor edit logic. I am also planning to add support of Comment prefix to RBQL. Unfortunately it is not possible to change color of lines with the comment prefix to the comment color because of some VSCode limitations ( I know about the “decorations” feature but it didn’t work well in my tests ). I hope this will change in the future and comment lines would be correctly highlighted.