The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 04-16-2009
Zykl0n-B Zykl0n-B is offline
Registered User
  
 

Join Date: Aug 2008
Posts: 25
Search a string in a text file in C

Hello,
I need help with a program i'm coding in C.

What my program has to do is to search a string in a text file, if it finds a match, print the string to stdout.

The file looks like:

000001 California
100000 Texas
011110 Ohio
010101 Washington

So, if the program finds a match, prints "100000 Texas" to stdout.

Could you help me?
Please excuse my poor english.