Intersect only the lines that "touches" the diagonal lines

Hi Forum,

I have a question. i have tried to intersect the diagonal lines with the lines that are vertical, but grasshopper is making a imaginary line that keeps going further as a diagonal line. How can i fix it to get the intersection only with lines that crosses and touches the diagonal ones and not the ones outside of the box?LinesTest.gh (48.5 KB)

I’ve already mentioned about data matching in this kind of case in your previous post, remember?
Anyway, check these two methods.

LinesTest_re.gh (35.4 KB)

Hi Kim, yes sorry, i was getting a little stuck but i have done it an other way. I have done it this way in my file. Now it also counts the rows to intersect.LinesTest.gh (51.9 KB)