Talk About Network



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 > Re: rename base...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 10 Topic 2205 of 2236
Post > Topic >>

Re: rename based on file name

by Ed Morton <morton@[EMAIL PROTECTED] > Mar 26, 2008 at 10:04 AM

On 3/26/2008 7:16 AM, tcdrake wrote:
> I have a couple of scripts which for the most part work but I need to
> change it up a bit based on new requirments. Here is what is currently
> happening.
> 
> Get 80 zip files in named yyyymmdd-(location).zip
> Unzip each zip to a folder based on location code in zip name.
> Rename the files to include yesterdays date.
> Zip up files and move to anyother directory based on location code.
> 
> All the above works fine if I only get one zip file per location per
> day. This is an issue when I get more than one zip file per location.
> So if I get 20080323-1.zip and 20080324-1.zip because the code I am
> using will just unzip the first one then unzip the second to the same
> folder which will over write the first ones before I am able to rename
> them.
> 
> What I need to do is unzip and rename the files based on the date of
> the zip file then zip all of the files into one zip based on
> yyyymmdd.zip.

This is a totally inappropriate application for awk. Yes, you can probably
hack
something together in awk to achieve your end result, but you could do
that with
an assembly code program too and that'd also be a poor approach. You
should be
doing this in whatever scripting language your OS supports. Post to an
OS-specific NG (e.g. comp.unix.shell if you're in UNIX or can download
cygwin
for Windows) for a good solution.

	Ed.




 10 Posts in Topic:
rename based on file name
tcdrake <rymills@[EMAI  2008-03-26 05:16:13 
Re: rename based on file name
Cesar Rabak <csrabak@[  2008-03-26 11:26:44 
Re: rename based on file name
Ed Morton <morton@[EMA  2008-03-26 10:04:06 
Re: rename based on file name
Ted Davis <tdavis@[EMA  2008-03-26 11:35:42 
Re: rename based on file name
Cesar Rabak <csrabak@[  2008-03-26 18:18:11 
Re: rename based on file name
Ted Davis <tdavis@[EMA  2008-03-26 19:10:01 
Re: rename based on file name
tcdrake <rymills@[EMAI  2008-03-28 08:30:29 
Re: rename based on file name
tcdrake <rymills@[EMAI  2008-03-28 10:08:26 
Re: rename based on file name
Ted Davis <tdavis@[EMA  2008-03-28 15:17:02 
Re: rename based on file name
Cesar Rabak <csrabak@[  2008-03-28 20:40:45 

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 May 16 23:31:58 CDT 2008.