Hi Ben,
If you don’t want to split the data into several worksheets, you could unstack columns instead. I added comments in the script I told you before, I think it will be easier to understand now:
wks.addCol("Group"); //Add a new column to store the group index
range rA = col(1);
int nRows = rA.GetSize(); //Get the rows number of column(1)
range rG = col($(wks.nCols));
int nGroup = 0;
string str$ = "H*"; //If the indicator is exactly "H", you could modify this line to string str$ = "H";
for(int ii = 1; ii <= nRows; ii++) //Loop over column(1)
{
if(Match(rA[$(ii)]$, str$))//To check if col(1)[ii] starts with the character "H"
{
nGroup++;
}
rG[$(ii)] = nGroup; //Fill the group index in col("Group")
}
//wsplit -r 2 mode:=ref ref:=col($(wks.nCols)); //Split the grouped data into several worksheet
//Modify irng1 according to your source data
wunstackcol irng1:=(2:5) irng2:=6; //Unstack the grouped data, more info: https://www.originlab.com/doc/X-Function/ref/wunstackcol


Regards,
Yuki
OriginLab