Set LINESEPARATOR before calling the Textfile tool.