My interpretation of your question is: You have a series of line segments touching end to end and you want them to be one line segment.
If this is correct, you might want to look at the Weld plugin.
Why did I think this? Because you said "connect".
If this is incorrect, ignore this reply.
Best wishes.