Re: [SLUG] File Renaming

From: Steve Szmidt (steve@szmidt.org)
Date: Fri Aug 20 2004 - 15:17:22 EDT


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Friday 20 August 2004 02:28 pm, Frank Roberts - SOTL wrote:
> Hi All
>
> I have approximately 2000 files in approximately 200 directories I would
> like to rename.
>
> To me the easies to explain this is by example.
>
> ----------------------
> Currently:
> The first directory's name be XXX-001 with files in the directory are named
> 001.jpg to 020.jpg
>
> The second directory's name be XXX-002 with files in the directory are
> named 001.jpg to 020.jpg
>
> And so on for 200 directories.
>
> ----------------------
> What I would like to rename the files as:
>
> The first directory's name remain XXX-001 but the file names in the
> directory to change to XXX-001-001.jpg to XXX-001-020.jpg
>
> The second directory's name remain XXX-002 but the file names in the
> directory to change to XXX-002-001.jpg to XXX-002-020.jpg
>
> And so on for 200 directories.
>
> ----------------------
> Each directory does not have the same number of files in it.
>
> Suggestions on how to do this would be appreciated.
>
> Thanks
> Frank

Got to run, but it could be two nested for loops or a find. (By the time I'm
back someone will have posted the short script. If not I'll send one to you.)

> -----------------------------------------------------------------------
> This list is provided as an unmoderated internet service by Networked
> Knowledge Systems (NKS). Views and opinions expressed in messages
> posted are those of the author and do not necessarily reflect the
> official policy or position of NKS or any of its employees.

- --
Steve

"They that would give up essential liberty for temporary safety deserve
neither liberty nor safety."
                                Benjamin Franklin

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFBJk5FljK16xgETzkRArhgAJ9ukId+GXhs6VdJhe5byVUIvthTyQCgg0m7
tiJfDy4mQ0uzpSdM215Gv8M=
=sqpc
-----END PGP SIGNATURE-----

-----------------------------------------------------------------------
This list is provided as an unmoderated internet service by Networked
Knowledge Systems (NKS). Views and opinions expressed in messages
posted are those of the author and do not necessarily reflect the
official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 15:04:00 EDT