question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ignoring comment lines

See original GitHub issue

Hello,

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:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
mechatronercommented, Aug 30, 2022

@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.

2reactions
mechatronercommented, May 7, 2020

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found