9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: erik quanstrom <quanstro@quanstro.net>
To: 9fans@9fans.net
Subject: Re: [9fans] silly question
Date: Tue,  2 Sep 2014 13:02:49 -0400	[thread overview]
Message-ID: <ab993a34ff2fe79b6e6ebfe90baa437e@ladd.quanstro.net> (raw)
In-Reply-To: <02adc2378671d0fb6129e699821979e0@quintile.net>

On Tue Sep  2 03:07:56 EDT 2014, steve@quintile.net wrote:
> I want to process some dated logfiles in awk.
>
> gawk has date, strftime and mktime but Brian's does not.

i'm not sure what your particular problem domain is since you don't say, but i've
always just used the standard awk functions to convert dates.  with string manipulation,
regular expressions, and associative arrays, i have not found a date conversion issue that
awk can't handle.  this has the advantage that a second awk isn't introduced to the system,
with all the resulting incompatibilites, and not requiring porting something from linux.

the operations that strftime the unix fn provides are implementable directly in awk.

speaking as one who has fallen into this trap, i think this might be an example of negative
pattern, too.  it's easy to get hung up on missing specialized function, when in fact the task
at hand doesn't really need it. stand up and shout if you remember the days when packages
would often fail to compile because they were looking for a function that wasn't really
necessary, and the test for that function failed in some unexpected way.  i wish i could
remember some of the examples.  they were spectacular.  and not in a good way.

- erik



  parent reply	other threads:[~2014-09-02 17:02 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-02  7:07 Steve Simon
2014-09-02  8:27 ` lucio
2014-09-02  8:46 ` arnold
2014-09-02  9:40   ` Jens Staal
2014-09-02 14:07     ` arnold
2014-09-02 14:22   ` Steve Simon
2014-09-02 14:29     ` arnold
2014-09-02 17:02 ` erik quanstrom [this message]
2014-09-02 18:18   ` Steve Simon
2014-09-02 19:10     ` erik quanstrom
2014-09-02 20:04       ` Bakul Shah
2014-09-02 21:05         ` erik quanstrom
2014-09-02 21:50           ` Kurt H Maier
2014-09-02 23:00             ` erik quanstrom
2014-09-02 23:04               ` Bakul Shah
2014-09-02 23:19                 ` erik quanstrom
2014-09-02 23:29                   ` Bakul Shah
2014-09-02 21:10         ` Skip Tavakkolian
2014-09-02 21:14           ` Steve Simon
2014-09-02 21:27           ` Bakul Shah
2014-09-02 21:43             ` Skip Tavakkolian
2014-09-02 18:36 ` Kurt H Maier
2014-09-02 19:18   ` Steve Simon
2014-09-02 23:34 sl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ab993a34ff2fe79b6e6ebfe90baa437e@ladd.quanstro.net \
    --to=quanstro@quanstro.net \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).