In your example if you enter "205" you will get nothing because there are no lines that contain "205"

But I understand what you mean anyway.
>>pls include the codes
Please first post your code to show us the effort you are making to solve the problem.
I would read the file one line at a time using fgets() function. Then you can use either strstr() to see if the line contains the search string, such as "205" and if it exists print the remainder of the line.
Code the problem one small step at a time to help from getting overwhelmed with the assignment. First, write the program that just opens the file. Get that to compile and work correctly. Then add to it the code needed to read each line using fgets(). Once that works you can continue with the reset of the assignment.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Offline 21,949 posts
since Aug 2005