Cliff:  Should work.

--Doug

See:

$ perldl
? wcols

 wcols()
    Write ASCII whitespaced cols into file from piddles efficiently.

    If no columns are specified all are assumed. Will optionally only
process lines matching a pattern. Can take file name or *HANDLE, and if
    no file/filehandle is given defaults to STDOUT.

    Options:

    HEADER - prints this string before the data. If the string is not
    terminated by a newline, one is added (default '').

     Usage: wcols $piddle1, $piddle2,..., *HANDLE|"outfile", [\%options];

    e.g.,

      wcols $x, $y+2, 'foo.dat';
      wcols $x, $y+2, *STDERR;
      wcols $x, $y+2, '|wc';
      wcols $a,$b,$c; # Orthogonal version of 'print $a,$b,$c' :-)

      wcols "%10.3f", $a,$b; # Formatted
      wcols "%10.3f %10.5g", $a,$b; # Individual column formatting

      wcols $a,$b, { HEADER => "#   a   b" };
...


[EMAIL PROTECTED]
Software Engineer III
UCAR - COSMIC, Tel. (303) 497-2611

On Fri, 30 Mar 2007, Cliff Sobchuk wrote:

Thanks Gents, can I specify the FileHandle as indicated by Chris's
email. Ex.
wcols $a->mv(1,0)->dog, *$out;
Where $out is a filehandle that changes as I am going through different
data sections? Is the * (not)required (i.e. pointer to filehandle)?

Cliff Sobchuk
Nortel Core RF Field Support

-----Original Message-----
From: Doug Hunt [mailto:[EMAIL PROTECTED]
Sent: Friday, March 30, 2007 2:58 PM
To: Chris Marshall
Cc: Sobchuk, Cliff (WIC:W788); [email protected]
Subject: Re: [Perldl] PDL - flat file export

Cliff, Chris:  No need even to specify *STDOUT:

wcols $a->mv(1,0)->dog

will do.

--Doug

[EMAIL PROTECTED]
Software Engineer III
UCAR - COSMIC, Tel. (303) 497-2611

On Fri, 30 Mar 2007, Chris Marshall wrote:

Cliff Sobchuk writes:
Hi Folks, I am struggling with how to get my data stored in to a flat

file (without all of the "[" "]" and blank
lines) so that I can plot the data with gnuplot. I have gone through
the FAQ, and the documentation on Indexing, Slices, Char, and Basic
and have not found a method to export the data easily. The data is
stored in a 3x20 array as a pdl and I want to be able to print it to
a file as 20 rows of 3 column values only.

The function(s) you are looking for are dog() and wcols().
For example:

perldl> $a = sequence(3,20);
perldl> wcols $a->mv(1,0)->dog, *STDOUT;
0  1  2
3  4  5
6  7  8
9  10  11
12  13  14
15  16  17
18  19  20
21  22  23
24  25  26
27  28  29
30  31  32
33  34  35
36  37  38
39  40  41
42  43  44
45  46  47
48  49  50
51  52  53
54  55  56
57  58  59

--Chris


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

Reply via email to