From: Avdi Grimm Date: 2008-04-29T01:47:47+09:00 Subject: Re: Transpose a large file(>2GB) On Sun, Apr 27, 2008 at 6:32 AM, Ams Lo wrote: > Hi - > > What is the fast and ruby way to transpose a large file(>2GB)?? fseek to the end of the file. fseek backwards by a nice round number like 4k. Read in that exact number of bytes. Transpose it. Write the transposed block to your output file. Then fseek back 2*4k. Read, transpose, write. fseek back 3*4k. Etc. Rinse and repeat to the beginning of the file. -- Avdi Home: http://avdi.org Developer Blog: http://avdi.org/devblog/ Twitter: http://twitter.com/avdi Journal: http://avdi.livejournal.com