I have a single line text file of csv values

I would like to able to 'pretty-print' the file to span multiple lines to make it more readable

The 1st no. represents the no. of csv values in the next section and so on 

e.g.

```
3,1,2,3,3,4,5,6

```

would be converted to:

```
3,1,2,3
3,4,5,6

```

I know a little about making macros, e.g.

```
C-x (
C-s RET ,
C-x )

```

using this I can do:

`C-u 3 C-x e` to move 3 csv values along

My sticking point is how to use the value from file to paste into the arg to `C-u`

maybe I should be using an e-lisp function instead as its a function I would like to 'save' for continual use across emacs sessions. Is it possible to save macros as such?

any ideas gratefully received