Data exports w/ PHP & MySQL
| From: | Glenn Antoine | Date: | Thu, 14 Dec 2000 21:55:31 +0000 |
| Subject: | Data exports w/ PHP & MySQL | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-30366@lists.php.net to get a copy of this message | ||
I am trying to write a generic utility for exporting data from mysql and
was hoping that I might be able to get some suggestions/ideas from some
of the gods.
My problem is that I have a several fixed-width file formats (specs)
that I have to use when exporting data from mysql. This enables me to
send the data out to an administrative group that makes use of the data
in a system that is very stringent about what the file format must be.
Some of the things that I have to keep in mind are:
Field width for each column
Starting point for each column
Justification within the field (left or right justified)
Some need to be zero filled
I would like to use the file format as a config file or something to
allow me the maximum amount of flexibility, because these formats change
on a fairly regular basis. The following is a snippet from one of the
file specs.
Field Description..............Field Length.........Field Position
Address-1...........................25....................190
Address-2...........................25.................... 215
City ....................................15.....................240
State.....................................2..................... 255
Zip Code............................10......................257
Phone.................................12......................267
Any suggestions/recommendations would be greatly appreciated. Thanks in
advance.
Glenn