Getting text into a table

From: Mark Morgan Lloyd <markMLl(dot)pgsql-general(at)telemetry(dot)co(dot)uk>
To: pgsql-general(at)PostgreSQL(dot)org
Subject: Getting text into a table
Date: 2008-12-10 13:10:58
Message-ID: ghof53$enp$1@pye-srv-01.telemetry.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I wonder if I could ask a question which might be marginally off-topic:
how do people assemble multiple lines of text into a row in a table?

I've got a number of cases where I've got a file containing some sort of
activity log, where a sequence of activities extends over multiple lines.

In some cases multiple activities might be interleaved, rather than each
activity comprising a sequence of contiguous lines.

Complicating things, related lines might be only recognisable by content.

As an example, a Sendmail maillog file where a delayed outgoing message
will result in a number of lines of text. I'd like each row in the table
to contain the sender, recipient, eventual state, and the time it took
to arrive at that state.

I'm sure I'm not the only person doing this sort of thing, but there has
to be a better answer than coding Perl for each job. Does anybody have
any suggestions for tools well-matched to this sort of problem, i.e.
that can match patterns, store matched patterns or update counters,
backtrack where necessary, and so on?

--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Albe Laurenz 2008-12-10 13:39:46 Re: c function - undefined symbols
Previous Message Quan Zongliang 2008-12-10 11:51:15 Re: c function - undefined symbols