Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

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.

share|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 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 –  MIH1406 Mar 31 '11 at 22:37
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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