Hena has asked for the wisdom of the Perl Monks concerning the following question:
11 12 13 21 22 23 31 32 33Now i need to transpose that. Originally i just read the whole matrix into memory as transposed arrays and wrote them out. Now this wont work when transposing to big files. Alternative way was to read one column at a time, but this will take a lot of time (perhaps would be faster to read 10 columns into 10 files, then cat them together).
Or i could use sysread, syswrite, sysread and sysseek in similar manner as above. However, when i'm reading the original matrix file.# loop for reading one column open (BINM,"<:raw"); read (BINM,$number,64); print OUTM "$number\t"; seek (BINM,64*$columns_number,1);
How do i write it out as doubles, into the binary file? Also if following values are also acceptable, how do they complicate things (case of characters could be set, but i'd prefer them to allow any case):while (<MATRIX>) { chomp; my @numbers=split (/\t/,$_); # problem }
[+-]?inf NaN
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Binary file handling
by hawtin (Prior) on Mar 18, 2004 at 09:35 UTC | |
by Hena (Friar) on Mar 18, 2004 at 09:51 UTC | |
|
Re: Binary file handling
by flyingmoose (Priest) on Mar 18, 2004 at 14:07 UTC | |
by Hena (Friar) on Mar 19, 2004 at 11:45 UTC | |
|
Re: Binary file handling
by husker (Chaplain) on Mar 18, 2004 at 14:15 UTC | |
|
Re: Binary file handling
by tachyon (Chancellor) on Mar 18, 2004 at 14:08 UTC | |
by Hena (Friar) on Mar 18, 2004 at 14:15 UTC | |
by tachyon (Chancellor) on Mar 18, 2004 at 14:53 UTC | |
by Hena (Friar) on Mar 19, 2004 at 08:59 UTC | |
by Hena (Friar) on Mar 19, 2004 at 11:40 UTC | |
by tachyon (Chancellor) on Mar 19, 2004 at 13:04 UTC | |
by tachyon (Chancellor) on Mar 18, 2004 at 14:19 UTC | |
by Hena (Friar) on Mar 18, 2004 at 14:38 UTC | |
|
Re: Binary file handling
by zentara (Cardinal) on Mar 18, 2004 at 16:48 UTC | |
|
Re: Binary file handling
by tachyon (Chancellor) on Mar 19, 2004 at 03:42 UTC |