Adding header to a delimited export
Brian K. White
brian at aljex.com
Mon Jan 10 09:23:05 PST 2005
----- Original Message -----
From: "Matthew Williams" <matthew.d.williams at gmail.com>
To: <filepro-list at lists.celestial.com>
Sent: Monday, January 10, 2005 12:06 PM
Subject: Adding header to a delimited export
> Hello all, it's been many months since I've posted but i'm back with a
> small problem.
>
> Currently I export UPS orders to a small delimited file, from there we
> would simply do a batch import into the UPS software and life was
> good.
>
> Recently UPS updated their software and now it requires that our file
> contain headers to identify the fields. It simply won't map field 1
> to customerID etc etc, you need the header to say "CustomerID" and
> then map it to their field.
>
> Why any software developer would make a change like this is beyond me
> and is just plain annoying but we can't just stop doing business with
> them and I guess it's not that big of a change.
>
> This is where one of you comes in! How do I append this header to my
> file? Could it be done with a simple sub-routine so it acts before
> any records are chosen and written to the file?
>
> Below is the line I use to export:
>
> Then: export word plant = /upss/ups.txt -r=\n -f=,
> Then: plant(1)=1;plant(2)=2;plant(3)=3;plant(4)=4;plant(5)=5
>
> Thanks a lot in advance! I'm sure this is a easy hack, just nothing I
> could find in the documentation (unless I didn't look hard enough).
Piece of cake.
----top----
Then: gosub exp
Then: plant(1)=1;plant(2)=2;plant(3)=3;plant(4)=4;plant(5)=5
@once: if:
then: gosub exp
then: plant(1)="CustomerID" ; ... ; plant(5)="DestinationZip"
then: end
exp: if:
then: export word plant = /upss/ups.txt -r=\n -f=,
then: end
----end----
If you don't have fp 5.0 then replace "@once" with your own manual setting
and testing a global variable to do the header gosub once before anything
else.
Brian K. White -- brian at aljex.com -- http://www.aljex.com/bkw/
+++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++.
filePro BBx Linux SCO Prosper/FACTS AutoCAD #callahans Satriani
More information about the Filepro-list
mailing list