[PLUG] Reformating date fields in text files
Russell Senior
russell at personaltelco.net
Fri Jan 14 23:16:07 UTC 2022
The other suggestion I'd make is to try some things at the command
line on one line of input (e.g. your example), and check to see you
are getting what you expect. You should be able to iterate quickly
that way and converge on something that will work.
One last clue: you can assign to a field and then print the modified
line with $0, e.g. { $6 = something_new ; print $0 }
I solved your problem in a couple minutes of fiddling, but I think it
would better serve you in the longterm to let you work it out for
yourself. In the context of having a kid in a college math class,
someone was admonishing me recently against "helping them with their
homework", which I wasn't anyway, but we do discuss what they are
being taught and I try to get them to explain it back to me and then I
ask "why?" a lot.
On Fri, Jan 14, 2022 at 3:04 PM Russell Senior
<russell at personaltelco.net> wrote:
>
> See also sprintf()
>
> On Fri, Jan 14, 2022 at 2:23 PM Rich Shepard <rshepard at appl-ecosys.com> wrote:
> >
> > On Fri, 14 Jan 2022, Russell Senior wrote:
> >
> > > Have you read the manpage where it discusses the split function? Maybe
> > > it's time to re-read that.
> >
> > Yep.
> >
> > Rich
More information about the PLUG
mailing list