Hi dkimia1001,
You can set up how you handle the file header, thus you can deal with the sweep 1 header, but the rows
in the sweep 2 are not file header, but already a part of the data; So, you won't be able to deal with
the second group at the import time, I think - you need a post processing. (The typical situation may be
that groups are stored in multiple files, then luckily all would go smoothly by multiple file import.)
Now, if you import the CSV file you get all headers may be stored in the first column. Then, for example,
you inserted a column, and running the following formula, you can set the group number there:
i==1?1:(left(col(2)[i]$,4)$=="time"?col(1)[i-1]+1:col(1)[i-1])
Please see the sample below:
Then, you can unstack the worksheet using this group column. ("Worksheet: Unstack" menu)
The header information in the first 3 rows can be moved by the following script, for example://///////////////////////////////////////////
for(ii=1; ii<wks.ncols; ii=ii+2) {
wcol(ii)[L]$=token(wcol(ii)[1]$,1,' ')$; //Time as Long Name1
wcol(ii+1)[L]$=token(wcol(ii)[1]$,2,' ')$+" "+token(wcol(ii)[1]$,3,' ')$; //Sweep# as Long Name2
wcol(ii)[U]$=token(wcol(ii)[3]$,1,' ')$; //Unit1
wcol(ii+1)[U]$=token(wcol(ii)[3]$,2,' ')$; //Unit2
wcol(ii)[C]$ ="Shear Stress";
wcol(ii+1)[C]$="Viscosity";
}
//wks.colsel(1,1); //Select col(1)
//mark -d %C -b 1 -e 3; //delete rows 1..3
//wks.colsel(1,0); //Unselect col(1)
/////////////////////////////////////////////
(Sorry for cheating by putting literals in the process for the column labels.)
See the result below:
I hope this sample procedure is helpful.
--Hideo Fujii
OriginLab