```{index} single: PDL::IO::Misc ``` # PDL::IO::Misc ```{pperl-module-badges} PDL::IO::Misc ``` Reading and writing ndarrays as text, and byte-order swapping. ```perl use PDL; my $x = short(1, 256); bswap2($x); print "$x ", isbigendian() ? "big" : "little", "-endian\n"; # [256 1] little-endian ``` `rcols` reads columns of numbers from a file into ndarrays and `wcols` writes ndarrays as columns; `swcols` writes them to a string, `rgrep` pulls values out of lines matching a pattern, `rasc` reads numbers from an ASCII file into an existing ndarray, and `rcube` stacks images into a cube. `bswap2`, `bswap4`, `bswap8`, `bswap12`, `bswap16`, `bswap24` and `bswap32` reverse the bytes of each element in place; `isbigendian` reports the host's byte order. This is PDL::IO::Misc of PDL 2.104: upstream's Perl, unchanged, over PDL's own kernels run by pperl's engine. `use PDL` loads it.