Re: CSV files with linefeeds in fields

2005-01-24 Thread Ken Youens-Clark
On Jan 22, 2005, at 2:06 PM, Rhet Turnbull wrote:
You might want to look at Text::xSV (
http://search.cpan.org/~tilly/Text-xSV-0.13/ ).  It handles embedded
linefeeds.
--Rhet
I wrote Text::RecordParser after playing with Text::xSV and finding 
some of it not quite to my liking.  It should work well for you:

http://search.cpan.org/~kclark/Text-RecordParser-0.08/
ky
On Sat, 22 Jan 2005 10:43:59 -0600, Eric Wilhelm 
<[EMAIL PROTECTED]> wrote:
Hi,
I've written some code before which uses the CSV.pm module (has this
never appeared on CPAN?)  But had to step-through the number of
quotes and read-in some extra lines to get a full record (where
linefeeds are embedded in fields.)
That was a terribly memory hog, and entangled with some task-specific
code (but I'm a better programmer now than I was two years ago.)  So,
I thought I would take a look at CPAN before I try to round-off this
square wheel.  From the looks of it, there isn't anything there for
this.
I looked at Text::CSV_XS and messed with Text::CSV::Simple, but both
of these seem to want a record to be only on one line.
I couldn't get AnyData::Format::CSV to work using either form of the
examples (could be that it isn't dying properly on errors?)
Tie::Handle::CSV looked promising, but also chokes on the embedded
linefeeds.
Any suggestions?  Did I miss something?  I would be happy to subclass
one of these and rewrite my step-over-linefeeds code into it, but I
can't help but think it must have been done before.
Thanks,
Eric
--
"Matter will be damaged in direct proportion to its value."
--Murphy's Constant




Re: CGI::FileManager

2004-04-30 Thread Ken Youens-Clark
On Fri, Apr 30, 2004 at 04:47:49PM -0200, Gabor Szabo wrote:
> 
> I am looking for a module that can be used as part of a web based
> application which requires management of a (partial) file system.
> If there is no such module I wonder if it would be interesting to add
> to CPAN ?
> 
> 
> In our current state operations required are
> - upload new file (with a customised hook to validate it before [1])
> - download file
> - rename
> - delete
> - merge two files (in a customised way so that will probably require
>   some hook or sub classing the module. [1])
> - edit file (in a customised way so this requires a hook too [1])
> 
> 
> [1] We are dealing with XML files so we'll have to edit those in some
> way that makes it simple for the user.
> 
> I saw Apache::FileManager but that is mod_perl dependent and this
> application should not be.
> 
> For uploading a file I could use CGI::Upload.
> 
> 
> So my questions are:
> - Is there such a module that someone could recommend ?
> - If there is no such module would a generic FileManager module using
>   CGI  be interesting on CPAN ?
> - What name ?  CGI::FileManager ?
> - What else should such a module include ?
> 
> 
> Gabor

Though it's somewhat of a distant memory to me now, I actually wrote
something like this a few years ago.  I vaguely remember looking at
Apache::FileManager and finding it illsuited for my requirements, so I
wrote something from scratch that was designed to integrate into an
Apache::ASP framework.  FWIW, my system included versioning with RCS,
which I thought was pretty k3wl.  For one existing example of a type
of browser-based file manager, you might look at Lincoln Stein's
Apache::MP3.  I know of no others to recommend you explore.  If you
can create something generic, reusable and extensible, I would by +1
for having it on CPAN.  "CGI::FileManager" is a fine name, but sounds
very Windows 3.1 to me.  How about "CGI::FileBrowser" or
"CGI::FileFinder"?  I will say from experience that this is a pretty
big undertaking, even more so if your hope is to release something
generic to CPAN.  But don't let that stop you from trying!

ky


pgp0.pgp
Description: PGP signature