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

  • SEARCH
  • Home
  • 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 8233269
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T18:04:27+00:00 2026-06-07T18:04:27+00:00

So I have a very large project which when run prints a data set

  • 0

So I have a very large project which when run prints a data set that is basicly this:

x,y,z,?,?

I want to find where this is being printed so i can remove this.

I have tried ack-grep for std::cout but there are so many files. Does anyone know how to search for std::cout and 4 commas in a line (ie. i know that std::cout and 4 commas will appear in the line but im not sure what else is there). I thought perhaps there would be some regular expression to use for this, as in find std::cout and “,” but four of them.

Any ideas?

  • 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-07T18:04:29+00:00Added an answer on June 7, 2026 at 6:04 pm

    Agreed pretty much on the approach of


    ack 'cout.+(.+,){4,}' --cpp

    Note that it’s .+ not .*, because .* will match a null string, so ,,,, would match. You want to make sure you have something in between the commas. I also added the --cpp flag so that it only selects C++ files to search through.


    Now, you said you wanted to delete every line that matches, so here’s how you can extend this solution to do that. Of course, you’ll want to make sure you have all you source code in version control, or at the very least have a backup, in case something goes wrong. I can’t tell exactly what your code looks like. You’ll have to do all the checking that the code works in your case.

    If you’ve found that every line that ack finds is one you want to delete, you can use Perl to remove those lines. The regex you use is the same because ack is in Perl and uses Perl regexes.


    ack -f --cpp | xargs perl -i -n -e'print unless /cout.+(.+){4,}/'

    The ack -f --cpp tells ack to generate a list of all the C++ files in the tree, and then xargs calls that Perl command line repeatedly. perl’s -i option says “Edit file in place”, -n tells Perl to loop over an input file, and -e gives the command to execute for each line. In this case, we’re telling Perl to print whatever line it just read unless it matches that regex. This effectively deletes the matching lines from each file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very large possible data set that I am trying to visualize
I have a very large XML file which has like 40000 data, and when
I have a very large set of permissions in my application that I represent
I have a very large project that uses Oracle ODP.NET. Right now it is
I have a very large project with tons of convoluted header files that all
We have a very large GWT project that results in a monolithic app about
I have a very large UIView approx 3000x3000 in size. In this large view
I have a very large data file with around 60000 rows. I need to
I have a very large list Suppose I do that (yeah, I know the
I have a very large program which I have been compiling under visual studio

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.