I have a text file with 10000's of lines in it.
On one of those lines will be device=varment & 1="0989 How do I search the entire file and only find and return this one line ??
Thanks 🙂
Does this have to be done in PHP, because it is a breeze over the command line:
cat file.txt | grep -n "device=varment & 1=\"0989"
Or run that via shell_exec() within your PHP script. 🙂
I'd prefer to do it in php and then return the line so I can manipulate it !! Thanks
Mad_T;11015635 wrote:I'd prefer to do it in php and then return the line so I can manipulate it !! Thanks
thus my shell_exec() suggestion
Then do as NogDog suggested and run it with shell_exec(). Just be careful if any input in that command comes from the user (i.e. a form, URL parameter, etc).