I am using Invoke-RestMethod to get data from a vendor in CSV format. The data is not in a format I need (it needs to be sent to another vendor) - there are four columns for each "set", and there can be any number of "sets" in the CSV - the column header names are not static - every four columns is a complete set.

Column1a, Column2a, Column3a, Column4a, Column1z, Column2z, Column3z, Column4z

data, data, data, data, data, data, data, data

What I need to do is export columns 1-4, 5-8, 9-12 etc. to separate CSV's. I do not even know where to begin for this.

![enter image description here](https://i.stack.imgur.com/vosdT.png)