Read from file and strip each lines and write to file.