On 5/18/2011 6:11 AM, Kåre Edvardsen wrote:

Can "wcols" be used any way for writing a variable of type:
pdl>  ?vars

Name         Type   Dimension       Flow  State          Mem
----------------------------------------------------------------
$names      Byte D [20,435]             P            8.50Kb PDL::Char

You can use dog() to split the piddle into single
columns that can then be written via wcols.  However,
you'll get the numeric code for the characters and
not the letters.  Here is something cooked up with
wcols through a pipe to generate the actual words.

pdl> use PDL::Char
pdl> $names = PDL::Char->new( [ 'hello', 'world', 'today' ] );

pdl> p $names
pdl> p $names
[ 'hello' 'world' 'today' ]

pdl> wcols $names->mv(0,-1)->dog, '| perl -ne "@c = split ; print map(chr,@c), 
qq{\n}"'
hello
world
today

Cheers,
Chris

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

Reply via email to