I've my `vmstat` output on a linux box as such:

```
# cat vmstat.out
procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 1  0      0 2675664 653028 3489156    0    0     1    19   22    7  5  1 94  0  0

```

I intend to keep the value under each field in a comma separated format along with timestamp(of course to use it as CSV file to be later transferred to our very loving MS Excel). So basically this is what I want:

Expected Output:

```
2016,05,19,23,53,58,1,0,0,2675664,653028,3489156,0,0,1,19,22,7,5,1,94,0,0

```

Script:

```
cat vmstat.out | awk 'BEGIN{"date +'%Y,%m,%d,%H,%M,%S'"| getline dt;}{if (NR> 2) {i=1;while (i < NF) {rec=rec","$i; i++;} print dt,rec;}}'

```

Output that I get from my script:

```
2016,05,19,23,53,58 ,1,0,0,2675664,653028,3489156,0,0,1,19,22,7,5,1,94,0

```

Note the extra space : `58 ,1` and the last `0` missing from Expected Output. I know the part in my script that is messing up is: `rec=rec","$i`

How to get around this ?