Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unzip, to rename or not to rename?

Status
Not open for further replies.

pbdude

Programmer
Feb 6, 2003
3
US
I receive a file on a monthly basis that is zipped. The zipped file is timestamped like 2003-01.zip, so I put it into a variable. Unzipping is no issue at all however, the txt file within the zipped file is a different name each month. I need this file to be the same name for other processes to handle. Is it possible to do this with unzip? If not, does anybody have any suggestions?

Thanks,
pbdude
 
Is there a problem with renaming it after unzipping it?

Guessing the filename is 2003-01.txt, something like mv ????-??.txt thismonth.txt? Annihilannic.
 
You could use...
[tt]
gunzip -c 2003-01.zip > thismonth.txt
[/tt]
What is the name of the zipped file that's changing each month? And what do you want it to be?

Hope this helps!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top