Re: Odd characters in filename
in message [EMAIL PROTECTED], wrote Joachim Dagerot thusly... 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). Bourne shell: sanename.sh ... http://www103.pair.com/parv/comp/src/sh/sanename.sh Perl: sanename, File::Name::Sanitize wrapper (requires knowledge of modules installation due to lack of makefiles; path adjustment may be needed in use lib q/path/ directive) ... http://www103.pair.com/parv/comp/src/perl/dist/sanename-1.01.tgz http://www103.pair.com/parv/comp/src/perl/dist/Parv-Util-1.00.tgz Some documentation: http://www103.pair.com/parv/comp/src/perl/sanename.pod http://www103.pair.com/parv/comp/src/perl/modules/File/Name/Sanitize.pm.pod http://www103.pair.com/parv/comp/src/perl/modules/Parv/Util/Compile.pm.pod See also... http://www103.pair.com/parv/comp/src/perl/modules/Parv/ http://www103.pair.com/parv/comp/src/perl/modules/File/Name/Sanitize.pm http://perlmonks.org/index.pl?node_id=303814 http://perlmonks.org/index.pl?node_id=277174 http://groups.google.com/groups?q=%22file+name%22+unusal+OR+weird+characters+group%3Acomp.unix.* http://groups.google.com/groups?q=rename+unusal+OR+weird+characters+group%3Acomp.unix.* - Parv -- ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Odd characters in filename
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? ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Odd characters in filename
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; }' \ filename... 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. Cheers, Matthew -- 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 pgpXkdxDkLANl.pgp Description: PGP signature