The UK Home Automation Archive

Archive Home
Group Home
Search Archive


Advanced Search

The UKHA-ARCHIVE IS CEASING OPERATIONS 31 DEC 2024

Latest message you have seen: Re: Over 100 Z-Wave Products Now Available in the UK


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Tag & Rename question....



On Tuesday 20 May 2003 21:07, Paul Gordon wrote:
> Hoping someone whose used T&R a bit can help me....
>
> I have a sizeable chunk of a library where the format is:
>
> <Artist>\<artist - album>       i.e there is a top level
folder for the
> artist, and underneath that is a folder per album, *but* the artist
name
> also appears as part of the album folder name....
>
> I want to change it so that the folder name exactly matches the album
name,
> i.e. like the following:
> <Artist>\<album>

Got perl? Do this:

perl -e 'for(`find . -type d`){chomp;$o=$_;if(s/.*-\s*//){rename $o,$_
unless
-d $_;};}'

It'll process a whole directory tree, and change <artist - album> to
<album>
regardless of the number of spaces in there. If <album> is non-unique
for a
particular <Artist> directory, it'll leave it alone.

cheers

ant
--
/\/\
www.ant.org  ('')  www.ant.org
()
Megawatt Winged Avenger



Home | Main Index | Thread Index

Comments to the Webmaster are always welcomed, please use this contact form . Note that as this site is a mailing list archive, the Webmaster has no control over the contents of the messages. Comments about message content should be directed to the relevant mailing list.