Adding Column Names & Metadata to Exports

Stanley - stanlyn.com stanley at stanlyn.com
Mon Oct 3 16:51:37 PDT 2016


Hi Mike,

I'm not sure if this helps, but it is not going to a spreadsheet, however
the idea is the same.  I'm using the fp's export routine like this and do
not see how to integrate a different stream for the metadata into the export
stream routine.

      │ If:
│
       Then: dim array(20):1 ; ct="1" ; f=""
│
  5  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
loop   │ If: ct le "20"
│
       Then: f=f&array(ct)&"^" ; ct=ct+"1" ; goto loop
│
  6  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
       │ If:
│
       Then: rr = "Birthday-"{ pp {""
│
  7  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
       │ If:
│
       Then: export ascii data=(rr) r=\n
│
  8  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
       │ If:
│
       Then: data(1)=f{"^"{pp
│
  9  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
       │ If:
│
       Then: write data          

Also related...  Is there a way to do processing on records AS they are
being exported?  It appears that we have little control with export.

Thanks,
Stanley




-----Original Message-----
From: Filepro-list
[mailto:filepro-list-bounces+stanley=stanlyn.com at lists.celestial.com] On
Behalf Of Mike Schwartz via Filepro-list
Sent: Monday, October 3, 2016 10:42 AM
To: filepro-list at lists.celestial.com
Subject: RE: Adding Column Names & Metadata to Exports

> How do I add the column name & number as the first row of data in an 
> export so the exported file will contain meta data about itself and be
self
> explanatory.  I'm using filepro for unix 5.0.14.
> 
> In particular, I'd like to create row 1 with the matching field name &
number,
> row 2 will contain meta data such as table name, row count, run time 
> and date, and finally starting at row 3 is the exported data.  The 
> values in
row 1
> needs to align with the values in the exported data.
> 
> Stanley

     Setup a subroutine at the bottom of your processing table that only
gets called once, but that writes the header row to the spreadsheet.  

     You will need to use the "write" command to write the header line to
the spreadsheet, then use "write" again to write the first data line, then
"write" again for each subsequent data line.  

      If you look back in the archives on this list for the work "export",
you should be able to find some sample code.  Otherwise I can dig up some
code with a header line this afternoon and send it to you.

Mike Schwartz




_______________________________________________
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