SQLite Forum

Unstack one column to multiple
Login
Dear Ryan, thanks for your reply.

With fixed number of fields, I have already succeeded to unstack and arrange the data into a proper table with sqlite itself using the combination of ROW_NUM() OVER() and MOD() functions.

With varied number of fields I have been doing this for long within Excel with PowerQuery. 

Though the number of fields is not fixed but there is a consistency in order of values in each record as you can see just last few values after 'Sec' there is variation in number of values, sometimes they are 3 values, sometimes 4 just before 2 line breaks. 

So there is a pattern to follow. Last 1 or 2 values of each record are not so important and can be eliminated to make the fixed number of fields per record.

How about deleting those 1 or 2 extra non blank values matching the MOD() of ROW_NUM() function for the fixed number?