CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
about grep

 



kevindai
Novice

Apr 12, 2009, 12:19 PM

Post #1 of 6 (790 views)
about grep Can't Post

I am trying to learn grep. How do i print or display email or date of birth or what ever!! from a file? i can compare the sequence of whatever i want, using reg. exp, but don't know how to use grep.


mykolg
User

Apr 12, 2009, 7:13 PM

Post #2 of 6 (787 views)
Post deleted by mykolg [In reply to]

 


kevindai
Novice

Apr 12, 2009, 7:47 PM

Post #3 of 6 (786 views)
Re: [mykolg] about grep [In reply to] Can't Post

I am not looking for unix grep. I want to get date of birth or email from a file using grep in perl. did i simplify it?

thanks in advance


In Reply To


senthilkumar_ak
Novice

Apr 17, 2009, 11:17 PM

Post #4 of 6 (766 views)
Re: [kevindai] about grep [In reply to] Can't Post

grep is a command in unix and you can use it extensively with the file. please post some file line and let me know how the the date of brith posted in the file.


KevinR
Veteran


Apr 18, 2009, 12:41 PM

Post #5 of 6 (755 views)
Re: [senthilkumar_ak] about grep [In reply to] Can't Post


In Reply To
grep is a command in unix and you can use it extensively with the file. please post some file line and let me know how the the date of brith posted in the file.


perl also has a grep function.
-------------------------------------------------


KevinR
Veteran


Apr 18, 2009, 12:43 PM

Post #6 of 6 (754 views)
Re: [kevindai] about grep [In reply to] Can't Post


In Reply To
I am trying to learn grep. How do i print or display email or date of birth or what ever!! from a file? i can compare the sequence of whatever i want, using reg. exp, but don't know how to use grep.


If you know how to use regexp, you know how to use grep.

@out = grep {/regexp/} input;

You can use other things inside the grep block, it doesn't have to be a regexp.

http://www.google.com/search?q=perl+grep+tutorial
-------------------------------------------------

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives