xChat ruined my life putting \r in the filename on Ubuntu, so I need to rename every log file without that \r or I can't copy to NTFS.
I tried to do it in Python but I ran into a major problem.
Listing files in the folder is fine and I get the whole name. But when I need to rename it, it somehow omits everything before the \r (including it), so the filename is invalid and Python assumes that file does not exist.
Would be nice if someone knew a workaround or would make a script for me.
Here's a sample output:
Printing the name as it gets detected:
['EvilZone\r-#animalsex.txt']
But when I copy that filename to NP++, it shows as \r\n. Either way it does not find a correct file.
Printing the name from a list:
-#animalsex.txt
So what I want to do in a nutshell is to take a file, get its filename that contains \r or \r\n, remove that/those symbols and rename the file with the same name without that/those symbols.