The sorting out blank rows comes down to one thing, how many they are, and that if they should be there or not. But first, have a look at this rows with both filled and empty rows:
Mark the whole data.
Press CTRL + G and click Special
Press Home (1), Choose a color with Cell Styles (2).
Note: Give the blank cells a unique color. It is recommended that you'd use only one color in the actual data.
Mark the whole data again.
Click on Data (1), and then on Sort (2).
Choose a category in Sort by (1), choose cell color on Sort On (2), No Cell Color in order (3), On Top (4), and then press ok.
Choose all the colored rows, right click on the marked rows (2), and choose delete (3).