Hi Gang,

On Sep 12, 2007, at 1:58 PM, bruce wrote:

if you're going to do the system approach, go ahead and use awk/cut...

wc -l foo.txt | awk -F' ' '{print $1}'

should work assuming you're on linux.....

I have solved the problem with this approach. Thanks for all the suggestions.

FYI, it was a (very) minor pain to make that into a string. I ended up using this:

$count = system("wc -l /path/to/myfile.txt | awk -F' ' '{print " . '$' . "1}'");

I didn't need to escape anything because the file was hardcoded - no user input.


Cheers,
Frank Schima
Foraker Design
<http://www.foraker.com>
303-449-0202


Reply via email to