Read contents of multiple text files and print out specific line, in PHP?

This is far easier to do with command line tools.

This is far easier to do with command line tools: exec("grep '^From: ' *. Txt|uniq", $output); That'll return ONLY the lines that start with From: from all the text files. A simple substring extraction gets you the actual email address, and you've saved yourself a lot of PHP busywork.

I'm working on a Windows platform. – Steve Aug 24 at 16:07 sure, as long as you've got grep and uniq installed (which are present on pretty much any linux/unix distribution). – Marc B Aug 24 at 16:07 Ah.

Well, you can use 'find' to accomplish some of this in windows. Not sure what'd you use for uniq though. – Marc B Aug 24 at 16:07 hmm.

Little confused now. I understand that its much easier using a direct statement in Linux, however I am working on an XAMMP (Apache) instance through Windows. Thanks for the help anyway.

– Steve Aug 24 at 16:10.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions