I have a .gz file and when i try extracting it, it has a .txt file and i want to open the .gz file and extract this .txt file and place it in another folder. Please advise how i can achieve this. I tried a few open source programs but didn't really work.
Unlike a .zip file, a .gz is just a single compressed file, though often that file is a tar archive. Let's assume your file is just a simple compressed text file. You don't even have to search around for an open source solution, because standard Java already includes a GZIPInputStream class. You can wrap your FileInputStream in that, and then wrap the result in a BufferedReader or whatever gives you the interface you want. Read the contents of the file and write it out in plain text where you want it to go.