[PLUG] awk string functions

Rich Shepard rshepard at appl-ecosys.com
Wed Jun 13 22:31:55 UTC 2018


On Wed, 13 Jun 2018, Russell Senior wrote:

> You probably want to look at substr().

   Thanks again, Russell. I now have a one-liner:
{ print substr($1,1,4)"-"substr($1,5,2)"-"substr($1,7,2), substr($2,1,2)":"substr($2,3,2), $4 }

That produces:

1988-10-01 00:30 0.75
1988-10-01 01:00 0.75
1988-10-01 01:30 0.75

Regards,

Rich



More information about the PLUG mailing list