------art_79732_31337987.1176863456507
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

@James, Right on. I think you're correct - FasterCSV should handle the CSV
reading no problem. I think my first edition might handle writing to a flat
file based on an XML schema. I'm going to try to think about generalization
from the beginning, and see if that keeps my code easier to maintain and
use. When you wrote FasterCSV, how did you bake in the formatting rules? Did
you write an XML schema or something similar based on the CSV RFC?

@Dan, Many thanks! XFlat seems like exactly what I need. Only I can't find
the DTD anywhere... is it proprietary?

Now you've both got me thinking about a text conversion swiss army knife ...
so long as a conversion library has access to input and output schemas,
there's no reason why our well-formed data can't enjoy total freedom. Which
I probably can't convince anyone to pay me to write, but I might anyway.
Hm... In any event, my little csv-to-flat_file_format_X tool is a good way
to introduce myself to text processing in Ruby. (And I'm hoping not that
tough...) :-)

This seems like a much stronger idea now. Thanks guys.

4fires

On 4/17/07, DDENNISON / up.com <DDENNISON / up.com> wrote:
>
> Hi,
>
> Since you are describing a lot of what I do (but not in Ruby), I thought I
> might point you here for some ideas:  http://www.unidex.com/overview.htm
>
> Essentially, that link describes a flat-file parser that reads a XML
> definition of the layout.  You might want to use that and model your own
> schema to accomplish something similar in Ruby.
>
> Best Regards,
> Dan
>
>
>
>
>              "Stephen Smith"
>              <4fires / gmail.com
>              >                                                          To
>                                        ruby-talk / ruby-lang.org (ruby-talk
>              04/17/2007 11:12          ML)
>              AM                                                         cc
>
>                                                                    Subject
>              Please respond to         Re: text processing library
>              ruby-talk@ruby-la
>                   ng.org
>
>
>
>
>
>
>
>
> @Botp, That's right up my alley... Here's where I'm headed. Since CSV file
> structure is a bit like vanilla icecream, I'd like to provide a file
> structure with more complexity or "flavor" as an input, along with some
> CSV'd data. That way I can read in the structure and the data separately
> and
> get my data out in the format I want. My inspiration is deBabelizer, but
> also now simply some kind of String#pack.
>
> On 4/17/07, Pe, Botp <botp / delmonte-phil.com> wrote:
> >
> > From: Stephen Smith [mailto:4fires / gmail.com] :
> > # go from csv to
> > # batch file automagically, and just writing a one-off for this one file
> > # format seems like a total waste of time.
> > # There are a bizillion of these formats out there, and I have
> > # to imagine
> > # spooning csv files into yet another format is pretty common.
> > # I'm wondering
> > # if Ruby already has a batch file library, something like
> > # text-format.rb only
> > # more useful?
> >
> > just in case you'd want to start anew, try getting some ideas fr
> >   1. http://www.devsource.com/article2/0,1895,1928561,00.asp
> >   2. http://fastercsv.rubyforge.org/
> >
> > kind regards -botp
> >
> >
> >
>
>
> .                                                                        This
> message and any attachments contain information from Union Pacific which may
> be confidential and/or privileged.
> If you are not the intended recipient, be aware that any disclosure,
> copying, distribution or use of the contents of this message is strictly
> prohibited by law. If you receive this message in error, please contact the
> sender immediately and delete the message and any attachments.
>
>


On 4/17/07, DDENNISON / up.com <DDENNISON / up.com> wrote:
>
> Hi,
>
> Since you are describing a lot of what I do (but not in Ruby), I thought I
> might point you here for some ideas:  http://www.unidex.com/overview.htm
>
> Essentially, that link describes a flat-file parser that reads a XML
> definition of the layout.  You might want to use that and model your own
> schema to accomplish something similar in Ruby.
>
> Best Regards,
> Dan
>
>
>
>
>              "Stephen Smith"
>              <4fires / gmail.com
>              >                                                          To
>                                        ruby-talk / ruby-lang.org (ruby-talk
>              04/17/2007 11:12          ML)
>              AM                                                         cc
>
>                                                                    Subject
>              Please respond to         Re: text processing library
>              ruby-talk@ruby-la
>                   ng.org
>
>
>
>
>
>
>
>
> @Botp, That's right up my alley... Here's where I'm headed. Since CSV file
> structure is a bit like vanilla icecream, I'd like to provide a file
> structure with more complexity or "flavor" as an input, along with some
> CSV'd data. That way I can read in the structure and the data separately
> and
> get my data out in the format I want. My inspiration is deBabelizer, but
> also now simply some kind of String#pack.
>
> On 4/17/07, Pe, Botp <botp / delmonte-phil.com> wrote:
> >
> > From: Stephen Smith [mailto:4fires / gmail.com] :
> > # go from csv to
> > # batch file automagically, and just writing a one-off for this one file
> > # format seems like a total waste of time.
> > # There are a bizillion of these formats out there, and I have
> > # to imagine
> > # spooning csv files into yet another format is pretty common.
> > # I'm wondering
> > # if Ruby already has a batch file library, something like
> > # text-format.rb only
> > # more useful?
> >
> > just in case you'd want to start anew, try getting some ideas fr
> >   1. http://www.devsource.com/article2/0,1895,1928561,00.asp
> >   2. http://fastercsv.rubyforge.org/
> >
> > kind regards -botp
> >
> >
> >
>
>
> .                                                                        This
> message and any attachments contain information from Union Pacific which may
> be confidential and/or privileged.
> If you are not the intended recipient, be aware that any disclosure,
> copying, distribution or use of the contents of this message is strictly
> prohibited by law. If you receive this message in error, please contact the
> sender immediately and delete the message and any attachments.
>
>

------art_79732_31337987.1176863456507--