1. A moving device in pipe lines, comprising; an inside magnet line in which three or more magnet elements are interconnected in the direction of magnet flux; an outside magnet element line which is provided slidably on the outside of the magnet elements of the inside magnet line; a switching means which switches the magnet poles of the inside magnet elements and the corresponding pair of the outside magnet elements in-phase or reversed phase; and a control means for controlling the each switching means by a preset program.