Help with grep

Reply

Join Date: Jan 2009
Posts: 1
Reputation: jmoo5 is an unknown quantity at this point 
Solved Threads: 0
jmoo5 jmoo5 is offline Offline
Newbie Poster

Help with grep

 
0
  #1
Jan 13th, 2009
Have to write a program that mimikes a grep. It has to search thru a given file for a certain pattern. I have no idea where to start. Help please.
Reply With Quote Quick reply to this message  
Join Date: Apr 2006
Posts: 349
Reputation: death_oclock will become famous soon enough death_oclock will become famous soon enough 
Solved Threads: 37
death_oclock's Avatar
death_oclock death_oclock is offline Offline
Posting Whiz

Re: Help with grep

 
0
  #2
Jan 13th, 2009
grep stands for global / regular expression / print. First try a search on a way of performing regular expressions in C. Then find a good tutorial on how those work.
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 5,851
Reputation: Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute 
Solved Threads: 749
Team Colleague
Salem's Avatar
Salem Salem is offline Offline
Void main'ers are DOOMed

Re: Help with grep

 
0
  #3
Jan 14th, 2009
> I have no idea where to start.
Read a file, and print it out unmodified.

Then add code to find a fixed string.

Then add code to implement each feature of a regexp in turn.

Each is a small-ish step, built on the success of the previous step.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC