Dropped Fields in Export
Bruce Easton
bruce at stn.com
Sun Apr 12 21:06:48 PDT 2015
I believe one way to handle this situation is to, for the first record
processed only, have it export first a heading row where every column is
populated (for example below I use a "~" char). To produce the heading
row, you could use something like:
xagain If:
Then: export ascii data = . . . . . .
------- - - - - - - - - - - -
If: dh eq "" '(start special heading prc)
Then: data(1)="~"; data(2)="~"; data(3)="~"... etc
------- - - - - - - - - - - -
If: dh eq ""
Then: data(4) = "~"; ........ data([highest col#])="~"
------- - - - - - - - - - - -
If: dh eq ""
Then: dh(1,*,g)="Y"; goto xagain 'to signal end of heading prc
------- - - - - - - - - - - -
'**NOTE: dh is global**
------- - - - - - - - - - - -
If: '(start normal exporting for all recs)
Then: data(1)=f&gg&....
.
.
.
All the lines above starting with "If: dh eq """ would only export just
ahead of the normal export of that first record being processsed.
Of course, once run, you then need to remove the first row from the
exported file.
Since you're on unix, you could use something like this outside of
filepro processing to automate removal of first row:
sed '1d' file.txt > tmpfile; mv tmpfile file.txt
Bruce
On 4/12/15 10:51 PM, Mike Schwartz wrote:
>> Currently I do the export in record number order. So wonder if I add a
> string
>> to record #1's empty fields like "EMPTY" and remove it later by replacing
>> "EMPTY" with "".
>>
>> Do you know if the output export file's structure is defined on what the
>> actually data looks like from the first record it processes, and holds
> true for all
>> subsequent records? My documents doesn't talk about any of this...
>>
>> Thanks, Stanley
> As I recall, each record gets truncated if the last fields in that
> record are empty. So doing putting "EMPTY" only at the end of record #1
> won't help.
>
> AFAIK, this is a problem only with filePro's EXPORT command. If you
> create the file any other way, I don't think you will have this problem.
> For example, see functions like: Writeline(), CREATE(), OPEN(), READ(),
> READLINE(), WRITE().
>
> Stuart Werner's filepro training books (Developer reference series)
> have good sections describing how to create output files using several
> different methods.
>
> Mike
>
>
> _______________________________________________
> 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