Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • Thanks for the great explanation. I see that the application of grep for this is pretty bad, these were just some extracurricular tasks that limited me to using grep. I was trying to figure out the application and use of different wildcards, your explanation helped a lot. For the 2million part using grep, could I preface the field to start with [2-9 ]followed by 6 [0-9]? Commented Nov 15, 2022 at 19:59
  • I used grep -E "^([^,]*,){5}[2-9][0-9][0-9][0-9][0-9][0-9][0-9]" and it seems to work for minimum 2 million sales Commented Nov 15, 2022 at 20:03
  • do you have any advice on how I could find the year that appears the most in the text file using grep? Commented Nov 15, 2022 at 20:44
  • @ZerosOnesTwos my only advice is not to use grep. It simply is the wrong tool for the job. You can't do this sort of calculation in grep alone. Look into tools like awk. Commented Nov 16, 2022 at 10:46