How can I group points by their Z value and draw a nurbs curve between them?

I have 50 points as seen in the screen capture. There are five different Z values between all the points, 10 points at each Z value.

I trying to figure out a way to group the points into five groups, each group having the same Z value.

I then need to draw a nurbs curve between the points in each group, yielding 5 nurbs curves. The finaly step will be lofting all five lines together to create a surface.

I appreciate any help!

Post code!

Thank you!