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

Re: CREATING A HEADER RECORD ON A TEXT FILE.



I'm assuming that your (summary) record has data based on the rows returned in
the detail.  If this is the case, you have two choices.

One: get all the summary information prior to writing your first line.  Write
your summary record, then all the details.  This does mean that you'll have to
read all, or most, of your data twice or store it in an array until you're able
to write it the file.  If this is a lot of data that may not be the best
solution.

Two:  Write all the detail to a temp file and calculate your summary
information
along the way.  When all the details have been written the temp file close it.
 Open another file and write your summary header.  At this point your best
alternative is to close the summary file and "call system using" <-- see your
manual and use the operating system to con-cat the detail to bottom of the
summary file.

--
Jeff T. Orwick            orwickj@tusc.com <- Full time address
http://www.tusc.com