Link to home
Start Free TrialLog in
Avatar of jerzyk
jerzyk

asked on

Searching for data inside a file

I have a script which read user input and append data to file. It is a html file. Now I need a script to search this file and print html page in returns.
The entires are separated by hardlines.
Is there a way to search such a file ?
Jerzy
Avatar of vmpn
vmpn

You cam search anything.  Could you be more specific about the file, that is the only way I might be able to provide you with complete solution.
ASKER CERTIFIED SOLUTION
Avatar of Nathan Stanford Sr
Nathan Stanford Sr
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
That's  right - you can search it in many ways , I think there are at least 3 ways of doing it :
1) Use "grep" , it returns lines matching a word or a regular expression.
2) Use a shell script reading line by line , better a perl script
3) Use in C something like
while(fgets(buf,80,fp)!=NULL) if(strcmp(match,buf)) do_something() ;

I want to help it makes me a better programmer please send me a copy or a file with simular data with the info changed and I will make a script to fix the problem.
I want to help it makes me a better programmer please send me a copy or a file with simular data with the info changed and I will make a script to fix the problem.

If you need help email me
nathan@cyberservices.com - Home
nathan_stanford@cabp.com - Work
A True Perl N. u T.