On Fri, Jun 04, 2004 at 11:41:38AM +0200, Joachim Dagerot wrote:
> I unpacked a rar file and find myself standing with a lot of files
> with strange characters like accents etc.
> When I do tab for completion the characters 'escapes' to for example
> "\264" (backward slash).
> I tried to write a small rename method in java but neither the
> File.list() or by providing the filename in args[0] makes java
> understand these odd characters.
> How can I rename these files in a not too manual way?

Hmmm... something like this:

    % perl -e 'for(@ARGV) { ($f = $_) =~ s/[^[:ascii:]]/_/g; rename $_, $f; }' \       

which will replace all non-ascii characters with '_'.  This doesn't
take any account of possible name collisions and it will probably get
it's knickers in a twist if you use it to rename whole directory
trees, rather than just files in the current directory.



Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
PGP: http://www.infracaninophile.co.uk/pgpkey         Marlow
Tel: +44 1628 476614                                  Bucks., SL7 1TH UK

Attachment: pgpXkdxDkLANl.pgp
Description: PGP signature

Reply via email to