mass export of data

jkantrowitz at genprotrans.com jkantrowitz at genprotrans.com
Sat Nov 13 07:24:27 PST 2004


Need to export in csv format (so it can be imported into Excel) all the data
fields and a header line for each filepro database file (customers, vendors,
etc.). There are several hundred fields per file.

Here's what I've written, but it's not working right.
I know I could laboriously code each field for the header values, and then
repeat it for the data values, but there are several hundred fields per file
and I thought what I'd written would work.  Just don't have alot of time to
figure it out, but I need the results ....any ideas where I've gone wrong?

Thanks in advance with any help you can offer.

Jay Kantrowitz
Systems Administrator
Genpro Inc.
jkantrowitz at genprotrans.com
Phone: 973-589-8200 ext. 540
Fax: 973-589-1810

---------------------------------- process table starts
here ------------------------------------------------------------
IF
THEN::f(4,.0); d(4,.0)
IF:fx eq ""
THEN:gosub fpfiles
IF
THEN:goto fields
IF
THEN:end

fpfiles:' ******************************************************::
IF:@qu eq ""   ''wq eq ""
THEN:co="HQ":
IF:@qu eq "GI" ''wq eq "gi"
THEN:co="GI":
IF:@qu eq "MB" ''wq eq "mb"
THEN:co="MB":
IF:
THEN:putenv "COMPANY",co:
IF:
THEN:fx(50,,g)="/pix/exports/csvexp/"{co{"_"{@fi{".csv"
IF:
THEN:system ">" <fx {""; system "chmod 666" <fx
IF:
THEN:gosub put
IF:
THEN:f="1"

templup:
IF:f gt numfield(-)
THEN:return
IF:
THEN:jay(""{f{"")=fieldname(-,f)
IF:
THEN:f=f + "1"; goto templup

fields:
IF:
THEN:gosub put
IF:
THEN:dim data(999):1
IF:
THEN:d="1"

datalup:
IF:d gt numfield(-)
THEN:end
IF:
THEN:jay(""{d{"")=data[d]
IF:
THEN:d=d + "1"; goto datalup

put:
IF:
THEN:export word jay=(fx)
IF:
THEN:return

@done:
IF:
THEN:close jay; write; end

----------------------------------------------- end of process table
here --------------------------------------------------




More information about the Filepro-list mailing list