Automatic Line Transformation