Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

GZIPOutputStream skips last row when writing to file  RSS feed

 
malki sabag
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,
I have a .csv file that I want to compress, I am using the GZIPOutputStream. My issue is when trying to write to file it doesn't write the last row.
my code is like this:

the src file looks like this:
first line, first word
second line, first word, second word
third line, first word, second word, third word

in the new file created I only see the first two rows.
what am I missing??
thank you for your help.
 
Tony Docherty
Bartender
Posts: 3205
78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could try adding a print statement in while loop to print out the bytes you are reading to make sure you really are reading in what you think you are reading in.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!