Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Reading .gz without uncompressing it

Hi All,

 

I need to read txt.gz file and but I dont want to extract it because I need only first row (header) and count of lines in the file.

 

Any help will be appreciated.

Labels (2)
6 Replies
vapukov
Master II
Master II

Hi @GopiSharma 

 

but how you are thinking to count the number of rows without unarchiving the file? even if it will be in memory, it is. still will be unarchiving

akumar2301
Specialist II
Specialist II

if you are on Liunx machine , check if you have zgrep/gunzip command.

 

if yes , you could use tSystem and Zgrep/gunzip .

vapukov
Master II
Master II


@uganesh wrote:

if you are on Liunx machine , check if you have zipgrep command.

 

if yes , you could use tSystem and Zipgrep .


for grep (pattern search) - yes

 

but for row counts?

 

in any case - 

zipgrep is a shell script and requires egrep(1) and unzip(1L) to function

it's not a "magic button" it uncompress the file and do the proper job 🙂

Anonymous
Not applicable
Author

Hi Vapukov

 

Thanks for responding. Actually I was thinking if we have some existing component in Talend that can do the similar stuff like in Unix.

 

zcat file.txt.gz | wc -l

 

 

Anonymous
Not applicable
Author

Thanks for responding Abhishek, but I am using Windows. Do you any window command that will do the same thing.

tamilselvan1
Contributor
Contributor

any update on the question