In your second row, you have two values for "var1". How do you want to handle such an occurrence? First value, last value, or do you want to output a separate observation for each value? In the latter case, what do you want to do with the other name/value pairs in the same input line?
It would be helpful if you posted the expected dataset from your input data.
... View more