Dynamic filename creation w/export

Joe Chasan joe at magnatechonline.com
Thu Jan 13 12:22:24 PST 2005


On Thu, Jan 13, 2005 at 11:21:51AM -0800, Matthew Williams wrote:
> The list has been quiet so I figured I would stir up some conversation.
> 
> I currently have a invoice file, each invoice is flagged with a rep
> code to distinguish who sold what.
> 
> Currently we print out hard copies and send them out to each of the reps.
> 
> I would like to setup a process that will export each invoice record
> (not every field, just a few specific fields, this is no big deal) to
> a simple delimited file which could then be e-mailed to the rep along
> with a Word file to import the file to make it look pretty and
> legible, this would save lots of time, paper and most importantly
> money.
> 
> There are about 20 or so rep codes (3 digit code) so I would like to
> be able to dump out all of these files at once in a batch.  The
> filename would simply be <repcode>.txt.
> 
> I believe I have a decent approach to this situation (just a simple
> output process with a selection set) but was curious to see how the
> pro's would approach it.
> 
> My ultimate question is how would I dynamically set that filename to
> the rep code?  Could it be done as a variable?  Could the date
> possibly be added to it?  Any code examples out there?

export takes variable file name as argument so i see no problem with
export ascii myfile=("invoice_"{rep_code_field{"_"{doedit(@t4,"8","yymd"){".txt)
with whatever field/record delimiters (e.g. r=\n f=, o=" c=") or 
other similar structure (where rep_code_field is the field # or dummy
variable containing this rep code)

i don't know enough about how your layout is and how you will be running
it but its possible you might need to consider append option to export
command.

--- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ---
-Joe Chasan-                      Magnatech Business Systems, Inc.
joe at magnatechonline.com           Hicksville, NY - USA
http://www.MagnatechOnline.com    Tel.(516) 931-4444/Fax.(516) 931-1264


More information about the Filepro-list mailing list