Re: shell script for removing unprintable characters in file names
- In reply to: Carl Johnson : "Re: shell script for removing unprintable characters in file names"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 30 Nov 2024 17:23:08 UTC
El día sábado, noviembre 30, 2024 a las 08:50:02a. m. -0800, Carl Johnson escribió: > Per olof Ljungmark <peo@nethead.se> writes: > > > Hi, > > > > I am tasked with recovering hundreds or more files created with > > unknown OSs and have unknown characters in the name, replaced with a > > '?'. > > > > Like file?nam?.??? > > > > Please, if you have such a script can you post or email it? Replacing > > the unknown character with anything, like '-' or '_' using whatever > > shell, sh, bash or csh. > You can use the 'file' command to see in which charset the file are encoded, ISO-8859-1 or UTF-8 or ... And then the command 'iconv' to convert them to the charset you need. matthias -- Matthias Apitz, ✉ guru@unixarea.de, http://www.unixarea.de/ +49-176-38902045 Public GnuPG key: http://www.unixarea.de/key.pub Annalena Baerbock: "We are fighting a war against Russia ..." (25.1.2023) I, Matthias, I am not at war with Russia. Я не воюю с Россией. Ich bin nicht im Krieg mit Russland.