I have a three column data file generated from a python script after some simulation. It has two parameters in the first two columns, and value of a function in the third. I read up that the data column should be in a specific format to input into pm3d in gnuplot. Is there a shortcut to format the data file into the pm3d format? (a blank line after every change in x value). Though my data points are evenly spaced, the data is all mixed up, so I am finding formatting a bit tough. Please help.
Example file
1 2 3
2 6 5
1 1 8
2 5 3
(original file has > 40000 lines)