Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8878677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T19:46:14+00:00 2026-06-14T19:46:14+00:00

I am trying to read tsv data using d3. However, my data has comment

  • 0

I am trying to read tsv data using d3. However, my data has comment lines as follows

#Comment line
@Different comment line
x    y
1    2
4    2
5    1

Is it possible to get d3 to ignore those lines?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T19:46:15+00:00Added an answer on June 14, 2026 at 7:46 pm

    D3 has no built-in way to ignore comment lines. Your easiest option is going to be to pre-process the file before parsing with D3:

    d3.text(url, 'text/csv', function(csv) {
        // remove comment rows with regex - not fully tested, but should work
        csv = csv.replace(/^[#@][^\r\n]+[\r\n]+/mg, '');
        var data = d3.csv.parse(csv);
    
        // ... now the rest of your code ...
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to read double data from the file that has different contents. For example
When trying to read data from mdb using backgroundworker I get an error The
I am trying to read from a file and encrypt the data using AES
I m trying read XML data using XML parser from Url( https://....etc ). But
am trying to read few lines from a txt file using JS,and i have
Im trying to read some json data using RestSharp. But im having some problems
Trying to read an RSS and select information using Linq but can't seem to
I am trying to write to a .tsv file using python's CSV module, this
Trying to read a log file line-by-line (in Java). This log file is being
Trying to read data from a TcpClient buffer into a byte array: private byte[]

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.