Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #14987

Re: Run AWK using shell_exec

From Ben Bacarisse <ben.usenet@bsb.me.uk>
Newsgroups comp.lang.php
Subject Re: Run AWK using shell_exec
Date 2015-02-27 11:14 +0000
Organization A noiseless patient Spider
Message-ID <87sidrvc6t.fsf@bsb.me.uk> (permalink)
References <bd5897d2-065d-4cf1-bd7f-cbcb3404cb25@googlegroups.com> <mcoev3$bt4$1@dont-email.me> <98db9ab8-dec1-4b3a-b790-285e967c64bb@googlegroups.com> <87egpcozxq.fsf@bsb.me.uk> <75f1d7f7-e73e-452c-acb6-07ac2c0fff0f@googlegroups.com>

Show all headers | View raw


"Dan'l B" <dan.hinckley@gmail.com> writes:
<snip>
> Thanks, still doesn't seem to work but I'll double-check the path. I
> do grasp the problem of variables in shell commands but is there an
> alternative way to get the highest and lowest values in a column of
> text in a multi-column text file using only PHP?

There's been one answer, but here's a different one just for fun:

  if (preg_match_all('/^(?:[^\s]+\s+){3}(-?[\d.]+)/m',
                   file_get_contents('fullyear.txt'),
                   $matches))
      echo min($matches[1]);

(The number pattern is a little generous, but that may not matter.)

-- 
Ben.

Back to comp.lang.php | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Run AWK using shell_exec "Dan'l B" <dan.hinckley@gmail.com> - 2015-02-26 14:40 -0800
  Re: Run AWK using shell_exec Jerry Stuckle <jstucklex@attglobal.net> - 2015-02-26 19:50 -0500
    Re: Run AWK using shell_exec "Dan'l B" <dan.hinckley@gmail.com> - 2015-02-26 17:21 -0800
    Re: Run AWK using shell_exec "Dan'l B" <dan.hinckley@gmail.com> - 2015-02-26 17:41 -0800
      Re: Run AWK using shell_exec Jerry Stuckle <jstucklex@attglobal.net> - 2015-02-26 20:51 -0500
      Re: Run AWK using shell_exec Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-02-27 02:23 +0000
        Re: Run AWK using shell_exec "Dan'l B" <dan.hinckley@gmail.com> - 2015-02-26 19:11 -0800
          Re: Run AWK using shell_exec Matthew Carter <m@ahungry.com> - 2015-02-27 00:28 -0500
          Re: Run AWK using shell_exec Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-02-27 11:14 +0000
        Re: Run AWK using shell_exec Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-02-27 14:17 +0100
          Re: Run AWK using shell_exec "Dan'l B" <dan.hinckley@gmail.com> - 2015-02-27 11:40 -0800
            Re: Run AWK using shell_exec Jerry Stuckle <jstucklex@attglobal.net> - 2015-02-27 16:03 -0500

csiph-web