You can use the General LS Linear Fit.vi to implement this. Take a look at the attached VI and see if this works for you.
The first column of the H matrix is the concatenation of all the X values for all the lines. The rest of the columns are just 1 for those X values in that line, and 0 for the X values that are not part of the line.
-Jim