Changed the Encode Line to a subroutine

To better trap for fileds that contain quotes and such.