Re: [Tutor] parse text file

2010-06-01 Thread Colin Talbert
? import bz2 input_file = bz2.BZ2File(r"C:\temp\planet-latest.osm.bz2","r") try: all_data = input_file.read() print str(len(all_data)) finally: input_file.close() Colin Talbert GIS Specialist US Geological Survey - Fort Collins Science Center 2150 Centre Ave. Bldg

Re: [Tutor] parse text file

2010-06-03 Thread Colin Talbert
import bz2 input_file = bz2.BZ2File(r'C:\temp\planet-latest.osm.bz2','rb') lengthz = 0 for uline in input_file: lengthz = lengthz + len(uline) print lengthz Thanks again for you help and sorry for the bad code in the previous submittal. Colin Talbert GIS Specialist US Geol

Re: [Tutor] parse text file

2010-06-03 Thread Colin Talbert
Dave, I think you are probably right about using decompressor. I couldn't find any example of it in use and wasn't having any luck getting it to work based on the documentation. Maybe I should try harder on this front. Colin Talbert GIS Specialist US Geological Survey - Fo