Hmm, I was only half lazy.  I put the version supporting multi-character 
record-separators here :

    http://svn.perl.org/modules/DBD-CSV/trunk/

Please test it and if it works I'll CPAN it.

P.S. Phillip is correct about Text-CSV_XS.  I accomplished this with a kludge - 
I do the record chopping in Perl and the CSV parsing in Text::CSV_XS.

--
Jeff

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Friday, April 27, 2007 04:50 PM
> To: 'Santosh Pathak', 'Garrett, Philip (MAN-Corporate)', [email protected]
> Subject: Re:  :CSV and multi character separator
>
>
> > From: Santosh Pathak [mailto:[EMAIL PROTECTED]
> >
> > Yes. Author has mentioned about its availability in next version. But I was
> > wondering how it is not yet released because comment was made in 2005.
> >
>
> I am a bad boy.  I added the code for that and didn't CPAN it.  I will do so 
> today.
>
> > I would like to use a DBI that works on flat files (with custom separator
> > i.e. |++|) and supports following,
> >
>
> Custom separator coming today.
>
> > 1. Multiple joins in single SELECT statement (Note its not just one LEFT or
> > RIGHT, there could be multiple joins)
>
> There are two ways you can currently join multiple tables, neither is optimal 
> - a) use non-explicit joins e.g. FROM foo,bar,baz WHERE ... or b) use a 
> temporary table to join foo and bar and then join baz against that, ad 
> infinitum.
>
> > 2. Tables having self relationship
>
> Again, temporary tables is the only current solution.
>
> > 3. Supports Table aliases (Not a hard requirement)
>
> That is already available with or without an AS - FROM foo AS bar / FROM foo 
> bar - both alias the table foo to the table bar.
>
> >
> > I tried DBD::AnyData, DBD::CSV, DBD::RAM but none of them meet my
> > requirements.
> >
>
> Not surprisingly - they all three use SQL::Statement (also by me) for their 
> SQL engine.
>
> > Does somebody know any DBD for flat files that will meet above requirements?
> >
>
> No, sorry, but patches and collaborators welcome.
>
> --
> Jeff
>
> > Thanks
> > - Santosh
> >
> > On 4/27/07, Garrett, Philip (MAN-Corporate) <[EMAIL PROTECTED]>
> > wrote:
> > >
> > > Santosh Pathak wrote:
> > > > Hi,
> > > >
> > > > I read on following site that DBD::CSV supports multi-character
> > > > separator. But I am not able to use it. my separator is |++|
> > > >
> > > http://www.annocpan.org/~JZUCKER/DBD-CSV-0.22/lib/DBD/CSV.pm<http://www.
> > > annocpan.org/%7EJZUCKER/DBD-CSV-0.22/lib/DBD/CSV.pm>
> > > >
> > > > Even after setting sep_char to |++|, it doesn't work.
> > > > Am I missing something?
> > >
> > > The current released version of DBD::CSV does not support this.  The
> > > author says he's added support to the next version, but I don't see it
> > > on CPAN yet.
> > >
> > > The problem is that DBD::CSV uses Text::CSV_XS to parse the CSV files --
> > > and that module does not support multi-char separators.  The newer
> > > version (not yet released) allows you to specify your own CSV parser,
> > > bypassing that limitation.
> > >
> > > - Philip
> > >
> >
>
>
>


Reply via email to