Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Awk > Obtaining filen...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 2136 of 2317
Post > Topic >>

Obtaining filename after receiving file from pipe

by Roland Rau <roland.rau@[EMAIL PROTECTED] > Jan 18, 2008 at 03:23 PM

Dear all,

I extract zip compressed data from an archive and pipe the output into 
gawk for further processing. Is there a way to obtain the name of the 
archive or of the compressed file?

If I am a bit unclear, I hope this small example illuminates my point:

unzip -p data1990.zip | gawk 'END { print FILENAME }'

results in
-

Although this was not surprising, I would prefer to either have data1990 
(i.e. the name of the compressed file, probably difficult since there 
could be many files in one archive) or the name of the archive
data1990.zip?
Is there a possibility to achieve this?

Hopefully, this is the right forum to ask this question.

Thank you very much in advance,
Roland

P.S. If it is necessary, I am using at this machine WinXP with unzip 
5.50 and GNU Awk 3.1.4.
 




 3 Posts in Topic:
Obtaining filename after receiving file from pipe
Roland Rau <roland.rau  2008-01-18 15:23:33 
Re: Obtaining filename after receiving file from pipe
Ed Morton <morton@[EMA  2008-01-18 14:53:01 
Re: Obtaining filename after receiving file from pipe
Roland Rau <roland.rau  2008-01-18 15:58:23 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 15:07:04 CDT 2008.