[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Formatting Problem with text files



I am writing a SQR which writes records to be used in a Microsoft Word
mail-merge.

The SQR filename is 'report.sqr', so it creates a text file called
'report.lis'. I wish to verify and reuse the data in report.lis, so I open the
.lis file and write to another text file.

When I write to this file, I get a blank line between every line of data.

 sample code:

open {outputfile} as 1 for-reading record=1200:vary #status
open {mergedata} as 2 for-writing record=1200:vary #status

let $Line = ' '
while 1=1
     read 1 into $Line:1200
 if #end-file = 1
     break
 end-if
 if rtrim($Line, ' ') != '' ! if line is not blank
          write 2 from $Line
 end-if
end-while

close 1
close 2


notes:

{outputfile} is a substitution variable for report.lis
{mergedata} is a substitution variable for the mailmerge data file

Does anyone know how to write text records to a file without adding a blank
line?

Sean Carroll
PeopleSoft Australia