Export Header lines to a CSV file

Brian K. White brian at aljex.com
Tue Aug 7 11:16:59 PDT 2012


On 8/7/2012 9:25 AM, Bob Simcoe wrote:
> Thanks to all for the tips.
>
> I ended up using Chris'loop suggestion, processing while sitting on the first record. This allowed me to have more than one header line. I already had the code for the header lines, but was using "end", which would bring up the next record, losing the first.
>
> Brian's @ONCE technique was simple and clean, but I could only get 1 header line.

You can write as many as you want.

@once
gosub exp
out(1) = "line1" ; out(2) = "line1" ; out(3) = "line1"
gosub exp
out(1) = "line2" ; out(2) = "line2" ; out(3) = "line2"
return


>
> Thank you
> Bob Simcoe
> CFO
> Mid-City Office Equipment Inc.
> A Women Business Enterprise
> P. 716.832.0138 x201
> C. 716.725.8311
> F. 716.832.0892
> Follow us on Facebook
>
> For a Better Day at the Office
>
>
> -----Original Message-----
> From: Brian K. White [mailto:brian at aljex.com]
> Sent: Monday, August 06, 2012 5:06 PM
> To: Bob Simcoe
> Cc: Filepro-list at lists.celestial.com
> Subject: Re: Export Header lines to a CSV file
>
> I do it in @once.
>
> Put the export line in a small gosub, say it's named exp
>
> At the top of the table gosub exp
>
> Then after the end of the normal per-record processing add an end if you didn't have one.
>
> After the end put the exp label, export, return
>
> After that put @once
>
> At the top of @once put gosub exp
>
> Then write the header fields
>
> Return.
>
> So the header is all created in @once, which runs before any record is loaded, and, the normal record processing doesn't have to include any "detect if I'm on the first record" logic, which both looks messy and runs on every record for no reason.
>
> --
> bkw
>
>
> On 8/6/2012 1:47 PM, Bob Simcoe wrote:
>> Hi
>>
>> fp5.0
>> windows xp
>>
>> How can I Export column headers when Exporting to a CSV file?
>> I use:
>>
>> Export word file.csv
>>
>> file(1) = 1 ; file(2) = 2 ....etc.
>>
>> Any help would be appreciated.
>> Thank you
>> Bob Simcoe
>> CFO
>> Mid-City Office Equipment Inc.<http://www.midcityoffice.com/>
>> A Women Business Enterprise
>> P. 716.832.0138 x201
>> C. 716.725.8311
>> F. 716.832.0892
>> Follow us on Facebook<http://www.facebook.com/pages/MidCity-Office-Furniture/298763689497?ref=ts>
>>
>> For a Better Day at the Office
>>
>> -------------- next part --------------
>> An HTML attachment was scrubbed...
>> URL: http://mailman.celestial.com/pipermail/filepro-list/attachments/20120806/f67e53e5/attachment.html
>> _______________________________________________
>> Filepro-list mailing list
>> Filepro-list at lists.celestial.com
>> Subscribe/Unsubscribe/Subscription Changes
>> http://mailman.celestial.com/mailman/listinfo/filepro-list
>>
>
>



More information about the Filepro-list mailing list