I'm trying to programatically duplicate rows in a Google spreadsheet. I would like the number of times the row is duplicated to be based on one of the values in the row itself.
For example, lets say I have a table like this:

You can see that there are numbers in column C. The value in column C is the number of times I would like to duplicate the row. This is what the desired result would look like:

Technically, if the value in column C was 3, we would be duplicating the row two times.
Any ideas on how to script a Google spreadsheet to do this would be great!
Thanks!