rcols() has an option to change the separator, I've used this in the past to read csv files.

Karl

On Jul 4, 2006, at 3:10 PM, Craig DeForest wrote:

Hmmm.... I think that this (parsing comma-delimited files) doesn't get much mention in PDL sources because Perl is so good at it. Something like:

        $pdl = pdl( map { [ split /\,/ ] } @lines );

or, slightly less tersely:

        @table = map { [split /\,/ ] } @lines;
        $pdl = pdl(@table);

That, in turn, is equivalent to the more long-winded form:

        @table = ();
        for my $line(@lines) {
                my @line = split /\,/, $line;
                push(@table, [EMAIL PROTECTED]);
        }
        $pdl = pdl(@table);

Cheers,
Craig



On Jun 27, 2006, at 8:58 PM, [EMAIL PROTECTED] wrote:


I sort of got into PDL because it sounded a very interesting way to do data manipulation. But I found it very hard to get going. I also found it was hard to find stuff unless you exactly knew what you where doing and what it was named. It was also very hard to find example scripts. I love example
scripts it is how I learn stuff.

My problem was that most of my files where in comma delimited format or from relational databases ( which I used a dbi modules to get). I really wanted example of how to get data from the following sources into PDL. But I found it hard to find resources and also ran out of time. So I didn't
end up doing it.

Celia






             Donald Jackson
             <[EMAIL PROTECTED]
ms.com> To

28/06/2006 12:43 cc
             AM
Subject Re: PDL Getting Started book Re:
                                       [Perldl] IDL thing










As a newbie user, I can attest to the need- the POD is pretty good, but
it's like a dictionary: you need to know what to look for in order to
find it!

I'd happily volunteer as a guinea pig for testing drafts on.

Don Jackson

Xavier Calbet wrote:

 If you all agree, we could start writing
a simple introductory PDL book...



_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl






_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl



_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl


_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to