dharple / detox

Tames problematic filenames
BSD 3-Clause "New" or "Revised" License
318 stars 19 forks source link

simple example for converting an ofending char to custom string #79

Open darked89 opened 3 years ago

darked89 commented 3 years ago

Hello,

would it be possible to include, be it in the Readme or some other place a fool proof example how to convert just one bad char to a custom string?

something to do:

good|bad|neutral.txt
# converted to:
good_or_bad_or_neutral.txt

I am aware that I can do it in shell using sed, but if some files have this mixture of strange chars better handled by detox on the pipilines or some other chars with a special meaning then it will be way better to fix it in one pass.

DK

dharple commented 3 years ago

Sure. I've added a set of instructions to help with understanding how to change the way detox translates characters.

https://github.com/dharple/detox/blob/main/HACKING-v1.md

However, I'm not sure this will fully solve your problem. Do you want detox to only change pipes to _or_, and leave all other characters alone? Or do you want detox to do what it normally does, but change pipes to _or_ instead of an underscore?

If it's the latter option, the instructions provided above will help. If it's the former option, well, you want detox v2, which is currently in beta.