detox for troublesome file names

My job occasionally requires that I handle files written and named in international character sets. Sometimes that is inconvenient, not in the least because file names can cause odd behavior at the command line, or interfere with the way files are managed or opened. My worst-case scenario was a file I couldn’t save after I had edited it, because the name of the file was interfering with the application’s ability to write to disk.

Manually renaming a file is the obvious solution, or if there is more than one, a fun little tool called detox will systematically convert nonstandard characters into boring equivalents. In my case, a Japanese file name might be changed from an unreadable sequence to something like “K-U_e_R_yen_ae_yo_o.doc” — which is easier for me to open, edit and send along.

By default detox will handle mundane things like converting spaces (which sometimes annoy me) to underscores, changing unusual character sets with analogues in common keysets, and weeding out characters which otherwise interfere with life at the command line — like certain quote marks or keycodes.

One of the nice things about detox is that it is configurable to a very low level, so if you don’t like the particular conversion it picks on its own, you can adjust it slightly for different results. That also means that specific sequences and character-to-character translations are probably doable.

As it is a command line tool there’s nothing really to show for it in action. The documentation is excellent and it makes a provisions for dry-runs with the -n flag, so you can test it once or twice if you have a fear of committment. There may be other ways to circumvent this issue but as an easy one-step solution to a lesser inconvenience, I find this acceptable. :D

About these ads

9 Responses to “detox for troublesome file names”


  1. 1 Vincent "Nootilus" Corlaix 2010/01/29 at 4:02 PM

    Hello m.K.

    First I would like to thank you for your blog and all you share with it. I’m quite still a newbie in the amazingly geek world of Linux and I only start to use and begin to understand how fun and powerful this system is, especially through the CLI. Thanks to you, I’m more and more comfident in using it that way.

    I have three questions regarding your last post and especially your screenshot for the CLI-Club :). You might have already explained this later but I should have missed it, obviously.

    1- What do you use to split the terminal this way? Is this dvtm? I’m not sure since you have something like a menu line at the bottom…

    2- I’ve already saw this and now I’m definetly curious. How do you manage to have an image in some place of your multi-terminals screen? (btw, a Scanner Darkly is definetly a great movie, as the book was terrific too)

    3- Is this the regular Nethack game? I don’t have vuemeters in mine :(

    Okay, I hope my questions won’t bother you. If so, just remove my post. If not, let me thank you again for your great work and tutorials.

    See you later!
    .V

  2. 6 Stan 2010/01/30 at 1:54 PM

    Heya K-Mandla!!

    I understand that you are run (and test) your OSes on old hardware, and you are also an Arch user.

    Might I point you over to a particular experiment several CrunchBang Linux users have been looking at?

    ArchBang — CrunchBang Linux (usually based on Ubuntu)- ported over to Arch Linux. Note: it’s not officially supported or anything like that…

    Here’s the thread: http://crunchbanglinux.org/forums/topic/5988/to-those-who-managed-to-get-a-archbangcruncharch/

    Please do tell us what you think of it, I look forward to hearing your opinion ;) .


  1. 1 Links 29/1/2010: Many New Releases of GNU/Linux, Oracle Makes Promises | Boycott Novell Trackback on 2010/01/30 at 10:03 AM
  2. 2 A simple batch encryption loop « Motho ke motho ka botho Trackback on 2010/02/05 at 10:05 AM

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




Welcome!



Visit the Wiki!

Some recent desktops


May 6, 2011
Musca 0.9.24 on Crux Linux
150Mhz Pentium 96Mb 8Gb CF
 


May 14, 2011
IceWM 1.2.37 and Arch Linux
L2300 core duo 3Gb 320Gb

Some recent games


Apr. 21, 2011
Oolite on Xubuntu 11.04
L2300 core duo 3Gb 320Gb

Enter your email address to subscribe to this blog and receive notifications of new posts.

Join 405 other followers

License

This work is licensed under the GNU Free Documentation License. Please see the About page for details.

Blog Stats

  • 3,960,377 hits

Archives


Follow

Get every new post delivered to your Inbox.

Join 405 other followers

%d bloggers like this: