Questions tagged [bz2]

For issues relating to bz2 which is the file extension of compressed files by bzip2.

Files compressed with bzip2 are frequently given the bz2 extension. bunzip2 should be used to decompress these files.

tar supports bzip2 with the -j option, which can be used to extract or create archives that are also compressed with bzip2.

Also see tag bzip2

106 questions
0
votes
1 answer

Decompression of bz2 file fails with error

So far I've tried to decompress using mac command line tool bzip2 -dc , it throws this error : 'huff+mtf data integrity (CRC) error in data', I've even tried recovering files using bzip2recover command it converted my 4 mb file into 6000 small bz2…
JD-V
  • 3,336
  • 1
  • 17
  • 20
0
votes
2 answers

Decompressing bz2 files on Windows

I am trying to decompress a bz2 file with below code snippet which is provided in various places: bz2_data = bz2.BZ2File(DATA_FILE+".bz2").read() open(DATA_FILE, 'wb').write(bz2_data) However, I am getting a much smaller file than I expect. When I…
fatih
  • 1,010
  • 1
  • 8
  • 20
0
votes
2 answers

Removing all empty .bz2 files from a folder

I have a folder (actually on HDFS but I don't think that affects the question) of .bz2 files. Some of these when decompressed give single empty files. I would like to remove all the .bz2 files which decompress to empty and I notice that they all…
tex94
  • 36
  • 3
0
votes
1 answer

process bz2 file and process using awk

I have a file called "text.bz2" which contains a number of records which i want to process. I have a script which successfully processes all the data in a standard text file and outputs the results to a different "results.txt" file, but the command…
villaman
  • 65
  • 3
0
votes
1 answer

Latent Semantic Indexation with gensim

In order to use the Latent semantic indexation method from gensim, I want to begin with a small "classique" example like : import logging, gensim, bz2 id2word = gensim.corpora.Dictionary.load_from_text('wiki_en_wordids.txt') mm =…
0
votes
0 answers

Find all titles in an XML with Elementree from a bz2 file

I'm new to parsing in XML and am stuck with my code regarding finding all titles (title tags) in an XML. This is what I came up with, but it is returning just an empty list, while there should be titles in there. import bz2 from xml.etree import…
J. Williams
  • 135
  • 3
  • 10
0
votes
0 answers

How to get size of `.sdcard` file which is compressed using bz2 (sdcard.bz2)

I have sdcard.bz2 file and used the Python's tarfile library to extract the file, I get an invalid header error. Is there a way to extract files in bz2 archive and to read the size of that file. I have tried extracting it using 7zip and I am able…
Pradeep S
  • 21
  • 2
  • 10
0
votes
1 answer

Python bz2 sequential compressor produces invalid data stream on low compression levels

I have a series of strings in a list named 'lines' and I compress them as follows: import bz2 compressor = bz2.BZ2Compressor(compressionLevel) for l in lines: compressor.compress(l) compressedData = compressor.flush() decompressedData =…
thornate
  • 4,902
  • 9
  • 39
  • 43
0
votes
0 answers

Import basehansard.sql.bz2 into MySQL

How can I import basehansard.sql.bz2 into MySQL? I tried extracting the file so that it was basehansard.sql (text file), but the data import still had an error (ERROR 1193 "Unknown system variable 'statement_timeout'"). The data source is…
0
votes
1 answer

extract bz2 file and open ncdf using R

I'm trying to open a bz2 compressed netcdf file from ftp, but can't get it to work. Any help is much appreciated. I've tried opening it directly using: url <-…
Lukas
  • 655
  • 8
  • 20
0
votes
1 answer

Trouble importing shared object in Python

I am attempting to import a shared object into my python code, like so: import bz2 to which I get the following error: ImportError: ./bz2.so: cannot open shared object file: No such file or directory Using the imp module, I can verify that…
RoboCop87
  • 825
  • 1
  • 8
  • 21
0
votes
2 answers

A number of PythonChallenges simply do not work in Python 3X

I'm a newbie trying #pythonchallenge, with some help! I'm in Challenge 8 and a simple command such as: import bz2 bz2.decompress('BZh91AY&SYA\xaf\x82\r\x00\x00\x01\x01\x80\x02\xc0\x02\x00 \x00!\x9ah3M\x07<]\xc9\x14\xe1BA\x06\xbe\x084') Won't work…
B Furtado
  • 1,488
  • 3
  • 20
  • 34
0
votes
1 answer

Using Javascript to make parallel server requests THREDDS OPeNDAP

For the following THREDDS OPeNDAP server: http://data.nodc.noaa.gov/thredds/catalog/ghrsst/L2P/MODIS_T/JPL/2015/294/catalog.html I would like to note four Attributes of every file in there. The attributes are: northernmost lattitude; easternmost…
0
votes
1 answer

Java Wget Bz2 file

I'm trying to webget some bz2 files from Wikipedia, I don't care whether they are save as bz2 or unpacked, since I can unzip them locally. When I call: public static void getZip(String theUrl, String filename) throws IOException { URL gotoUrl =…
Danielson
  • 2,605
  • 2
  • 28
  • 51
-1
votes
1 answer

Is there any way to parellelly grep through bz2 files

I recently found out this solution to less through compressed gz files parellelly based on the cores available. find . -name "*.gz" | xargs -n 1 -P 3 zgrep -H '{pattern to search}' P.S. 3 is the number of cores I was wondering if there was a way…
john.p.doe
  • 411
  • 2
  • 10
  • 21