CSV export issues

Mike Schwartz mschw at athenet.net
Mon Jul 3 15:20:03 PDT 2017


> Another minor annoyance:  I wanted to define the output file from data in
> the filePro input. Say field 1 is the customer number:
> 
> 	f = 1 { "-" { @td; export word rpt=f
> or
> 	f = 1 { "-" { @td; export word rpt=(f)
> 
> Neither works.
> 
> --
> JP

     I don't see where anybody addressed this 2nd annoyance, so I will take
a shot at it.

     In your processing, on a line that gets executed BEFORE you hit any of
the data you want written, put a line like this:

export word rpt= /usr/tmp/report.csv

     Then make your lines look like this:

 	f = 1 { "-" { @td; write rpt
or
	f = 1 { "-" { @td; write rpt

     Note that if there is a "write rpt" any place in your processing table
and your processing does NOT encounter a "write" statement, no record will
be written to the output file, so make sure you execute a "write" command
every time you want to write a line to the output file.
   
     Each time you hit a "write" it will send one record to the .CSV file,
so make sure you only hit a "write" line once for each record you want
written.  Using the write control feature, it is possible to write no lines,
1 line or multiple lines to the .CSV file for each main database record you
work from.  Without using "write", you are going to get exactly one record
written to the .CSV file for each filePro record you encounter.

     The filPro export command is very versatile. I've done a lot of .CSV
and other exports for my clients in the mail order and insurance businesses
and rarely needed to resort to doing multiple data passes or writing batch
scripts.  For example, to do this report on a per department basis suppose
field 1 is the department number.  make FN="/usr/tmp/dept" {1 {".csv" and
then make your export line:  export word rpt=(FN)

     And if the inches vs. quote thing is still troubling you, take a look
at other exports you can do, such as Wordperfect, dif, or multi.  Your
customers may have better luck inporting one of those formats.

Mike Schwartz


     






More information about the Filepro-list mailing list