[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Re: Formatting Problem with text files
- Subject: Re: Formatting Problem with text files
- From: "Jeff T. Orwick [C]" <orwick@CIG.MOT.COM>
- Date: Fri, 12 Apr 1996 11:08:31 -0500
- In-Reply-To: Sean Carroll <Sean_Carroll@PEOPLESOFT.COM> "Formatting Problem with text files" (Apr 11, 11:36pm)
- References: <199604120643.CAA03710@po_box.cig.mot.com>
I'll bet that the text you're reading from the .lis file contains a ctrl-M
(return character) and that combined with the return generated when write to
the file create the blank lines.
Try this:
encode '<10>' into $return
inside loop:
Let $Line = translate($Line,$return,'')
If $Line does contain a return this should remove it.
On Apr 11, 11:36pm, Sean Carroll wrote:
> Subject: 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
>-- End of excerpt from Sean Carroll
--
Jeff T. Orwick orwickj@tusc.com <- Full time address
http://www.tusc.com