I want to extract data from large group of files based on a regular expression.

Is their an application, script, batch or terminal command to do this?

  • If you want to extract data from regular expressions, I suggest you use regular expression tools, this will help you extract valid data from source code faster You can check this article:helpcenter.octoparse.es/hc/es/articles/… – Melia Feb 11 at 8:38

grep should be what you want. It is very powerful. You can search multiple files for a pattern and you can even select the matcher.

There are many many options so you should really look up its man page I've linked you to.

| improve this answer | |
  • 1
    awk and sed are also very powerful tools for parsing text files. – Nick Pascucci Mar 27 '11 at 16:41
  • @codeMonk very true. You should post that as an answer. – Octavian A. Damiean Mar 27 '11 at 16:55
  • yes grep is very powerful!! But is there a way to output the found regexp? grep usually outputs the whole line + filename – malhobayyeb Mar 31 '11 at 22:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.