in reply to Re^5: How can I replace the pattern in the 6 th field?
in thread How can I replace the pattern in the 6 th field?

... the solution really depends on the actual detailed data format, which we don't really know.

Well, we know what I would consider to be a second approximation to the actual, rather messy data format (see My ACTUAL data...) — with more to come I shouldn't be surprised.

Splitting the input on the first dash ... with an appropriate LIMIT ...

But a data record like
    Jun 12 09 mail (sender@sender.com) - (recip1@domain.com) 0.075 9387, queued_as: C77837C0050 Subject goes here Sender(sender@sender.com)
has multiple parenthesized fields/substrings after the first dash, not all of which have to be fixed up, so it seems we're stuck with split-ing on whitespace.


Give a man a fish:  <%-{-{-{-<

Replies are listed 'Best First'.
Re^7: How can I replace the pattern in the 6 th field?
by Laurent_R (Canon) on Jun 19, 2018 at 07:54 UTC
    Yes, sure, if the parens should be removed only on the sixth (or actually seventh) field, with the field separator deemed to be one space (or possibly several consecutive spaces), and not thereafter, then we have to split on white space and make the substitution on the field (seventh) which needs to be changed. This requirement was not in the OP (to which I was really answering) and was added at a later point.

    The problem is still that the data seems to be almost free format (or at least with a very poorly defined format), I would also not be surprised if we discover new requirements.