writeFile and Carriage Returns

I’m having trouble getting CR’s to seperate lines in a text file. Here’s what I have:

def PrintTicket (LineIndex,PartIndex,PrnName): import system.file TriggerName = "C:\BarTender\TriggerFiles\MoveTicket.dat" FormatName = "D:\BarTender\MoveTickets\LabelFormats\MoveTicket.btw" LineTxt1 = '%BTW% /AF=' + FormatName + ' /PRN=' + PrnName + ' /R=3 /D=%Trigger File Name% /P /DD \r' LineTxt2 = '%END% \r' LineTxt3 = '22,2222,82222,123,07/23/2012,9:22AM,1,ZZZZ,3,2121,Stuff,33,Other,44 \r' OutputData = LineTxt1 + LineTxt2 + LineTxt3 system.file.writeFile(TriggerName, OutputData)

I’ve tried various combinations of escape () characters like \r, \n,etc. What I get is one long line. Any help would be appreciated.

Are you using Windows notepad to view the text file? It appears that notepad needs both (\r\n) to read a newline.

1 Like

You are correct! Thanks.