Re: fseek In Compressed Files

2014-02-04 Thread Ayushi Dalmia
On Tuesday, February 4, 2014 2:27:38 AM UTC+5:30, Dave Angel wrote: > Ayushi Dalmia Wrote in message: > > > On Thursday, January 30, 2014 4:20:26 PM UTC+5:30, Ayushi Dalmia wrote: > > >> Hello, > > >> > > >> > > >> > > >> I need to randomly access a bzip2 or gzip file. How can I set the o

Re: fseek In Compressed Files

2014-02-03 Thread Dave Angel
Ayushi Dalmia Wrote in message: > On Thursday, January 30, 2014 4:20:26 PM UTC+5:30, Ayushi Dalmia wrote: >> Hello, >> >> >> >> I need to randomly access a bzip2 or gzip file. How can I set the offset for >> a line and later retreive the line from the file using the offset. Pointers >> in th

Re: fseek In Compressed Files

2014-02-03 Thread Serhiy Storchaka
30.01.14 18:21, Peter Otten написав(ла): Do you know an efficient way to implement random access for a bzip2 or gzip file? See dictzip and BGZF. Unfortunately Python stdlib doesn't support them. -- https://mail.python.org/mailman/listinfo/python-list

Re: fseek In Compressed Files

2014-02-01 Thread Dave Angel
Ayushi Dalmia Wrote in message: > > > The size of this file will be 10 GB. The version of Python I am using is > 2.7.2. Yes, performance is an important issue. > Then the only viable option is to extract the entire file and write it to a temp location. Perhaps as you extract it, you could

Re: fseek In Compressed Files

2014-01-31 Thread Ayushi Dalmia
On Friday, January 31, 2014 12:16:59 AM UTC+5:30, Dave Angel wrote: > Ayushi Dalmia Wrote in message: > > > On Thursday, January 30, 2014 4:20:26 PM UTC+5:30, Ayushi Dalmia wrote: > > >> Hello, > > >> > > >> > > >> > > >> I need to randomly access a bzip2 or gzip file. How can I set the o

Re: fseek In Compressed Files

2014-01-31 Thread Ayushi Dalmia
On Thursday, January 30, 2014 9:51:28 PM UTC+5:30, Peter Otten wrote: > Serhiy Storchaka wrote: > > > > > 30.01.14 13:28, Peter Otten написав(ла): > > >> Ayushi Dalmia wrote: > > >> > > >>> I need to randomly access a bzip2 or gzip file. How can I set the offset > > >>> for a line and later

Re: fseek In Compressed Files

2014-01-30 Thread Dave Angel
Ayushi Dalmia Wrote in message: > On Thursday, January 30, 2014 4:20:26 PM UTC+5:30, Ayushi Dalmia wrote: >> Hello, >> >> >> >> I need to randomly access a bzip2 or gzip file. How can I set the offset for >> a line and later retreive the line from the file using the offset. Pointers >> in th

Re: fseek In Compressed Files

2014-01-30 Thread Peter Otten
Serhiy Storchaka wrote: > 30.01.14 13:28, Peter Otten написав(ла): >> Ayushi Dalmia wrote: >> >>> I need to randomly access a bzip2 or gzip file. How can I set the offset >>> for a line and later retreive the line from the file using the offset. >>> Pointers in this direction will help. >> >> with

Re: fseek In Compressed Files

2014-01-30 Thread Ayushi Dalmia
On Thursday, January 30, 2014 4:20:26 PM UTC+5:30, Ayushi Dalmia wrote: > Hello, > > > > I need to randomly access a bzip2 or gzip file. How can I set the offset for > a line and later retreive the line from the file using the offset. Pointers > in this direction will help. We are not allowed

Re: fseek In Compressed Files

2014-01-30 Thread Serhiy Storchaka
30.01.14 13:28, Peter Otten написав(ла): Ayushi Dalmia wrote: I need to randomly access a bzip2 or gzip file. How can I set the offset for a line and later retreive the line from the file using the offset. Pointers in this direction will help. with gzip.open(filename) as f: f.seek(some_p

Re: fseek In Compressed Files

2014-01-30 Thread Chris Angelico
On Fri, Jan 31, 2014 at 12:34 AM, Ayushi Dalmia wrote: > where temp.txt is the posting list file which is first written in a > compressed format and then read later. Unless you specify otherwise, a compressed file is likely to have sub-byte boundaries. It might not be possible to seek to a spec

Re: fseek In Compressed Files

2014-01-30 Thread Ayushi Dalmia
On Thursday, January 30, 2014 4:20:26 PM UTC+5:30, Ayushi Dalmia wrote: > Hello, > > > > I need to randomly access a bzip2 or gzip file. How can I set the offset for > a line and later retreive the line from the file using the offset. Pointers > in this direction will help. This is what I hav

Re: fseek In Compressed Files

2014-01-30 Thread Peter Otten
Ayushi Dalmia wrote: > I need to randomly access a bzip2 or gzip file. How can I set the offset > for a line and later retreive the line from the file using the offset. > Pointers in this direction will help. with gzip.open(filename) as f: f.seek(some_pos) print(f.readline()) f.seek(s

fseek In Compressed Files

2014-01-30 Thread Ayushi Dalmia
Hello, I need to randomly access a bzip2 or gzip file. How can I set the offset for a line and later retreive the line from the file using the offset. Pointers in this direction will help. -- https://mail.python.org/mailman/listinfo/python-list