awk -F, '{ for (i=2 ; i<=25 ; i++) {
printf("%s,%02d:00,%.2f\n",$1,i-2,$i+296.93) } }'

On Sun, Jul 22, 2018 at 1:24 PM, David Fleck <[email protected]> wrote:

> On Sun, 2018-07-22 at 12:26 -0700, Rich Shepard wrote:
> >
> 2006-10-01,10.72,10.70,10.72,10.69,10.66,10.65,10.66,10.66,
> 10.66,10.64,10.64,10.63,10.63,10.64,10.64,10.65,10.68,10.68,
> 10.67,10.68,10.69,10.69,10.69,10.67
> > 2006-10-02,10.67,10.67,10.67,10.67,10.68,10.67,10.68,10.68,
> 10.68,10.68,10.68,10.68,10.68,10.68,10.64,10.64,10.69,10.75,
> 10.74,10.70,10.69,10.71,10.70,10.70
> > 2006-10-03,10.70,10.70,10.71,10.72,10.72,10.71,10.72,10.72,
> 10.72,10.72,10.72,10.72,10.72,10.72,10.71,10.71,10.71,10.72,
> 10.73,10.73,10.72,10.70,10.70,10.71
> > 2006-10-04,10.72,10.73,10.73,10.73,10.72,10.73,10.72,10.72,
> 10.72,10.73,10.72,10.72,10.72,10.72,10.72,10.72,10.70,10.70,
> 10.69,10.69,10.70,10.71,10.73,10.73
> > 2006-10-05,10.74,10.75,10.71,10.69,10.71,10.74,10.75,10.74,
> 10.71,10.70,10.69,10.70,10.69,10.70,10.70,10.71,10.72,10.72,
> 10.71,10.70,10.70,10.71,10.72,10.71
> > 2006-10-06,10.70,10.70,10.72,10.74,10.74,10.74,10.74,10.72,
> 10.72,10.69,10.66,10.67,10.72,10.73,10.73,10.71,10.68,10.71,
> 10.75,10.77,10.75,10.73,10.72,10.69
> >
> >    The awk script intends to change this wide format to a long format.
> Each
> > line will have the date ($1), an added hour, then the numeric value ($3).
> >
> >    I've looked in my awk book and searched the web (perhaps with the
> wrong
> > search terms) and haven't found my syntactical error. Help is needed.
> >
> > Rich
> > _______________________________________________
> > PLUG mailing list
> > [email protected]
> > http://lists.pdxlinux.org/mailman/listinfo/plug
>
> Rich-
> I got the attached script to do what you want (I think).  Note that I
> had to eliminate your readable formatting so as not to get extra spaces
> in the output.  Essentially, it was a matter of moving the quotes and
> commas around.
>
>
> _______________________________________________
> PLUG mailing list
> [email protected]
> http://lists.pdxlinux.org/mailman/listinfo/plug
>
>
_______________________________________________
PLUG mailing list
[email protected]
http://lists.pdxlinux.org/mailman/listinfo/plug

Reply via email to