SQLite Forum

Unstack one column to multiple
Login
> The number of fields for each record also varies.

That's the problem - if we do not have any idea how many rows (fields) there may be per record, there is no way to do what you want.

If the row (field) count was constant per record, the problem would be trivial to solve, since we would know the first row means the description, the second row is the make, then the product detail identifiers etc. etc.

But now we don't know what the rows may be, so it is impossible to do. Unless you have some rule that may help, like "If there are 10 rows exactly then row 5 means X and row 7 means Y etc, and if there are exactly 12 rows, then row 6 is X and row 8 is Y, etc.

Also, if you need to do this one time, I would suggest it is easier to just drop it in a spreadsheet and do it, or write a small bit of code to do it. If this is something that needs importing regularly, then write some more robust code to do it. SQL cannot solve your problem.