+ 1
Remove characters from file names
I am trying to remove spaces and parentheses from files with a specific extension. can anyone give me a real world example of python code to accomplish this?
3 Antworten
+ 1
A small workaround till a good solution :
1. Read the file contents
2. Save the filename in a variable (if possible)
3. Trim the string (in Java you have the String.trim() method)
4. Create a new New file with the name of the trimmed variable and save the saved content in it
5. Delete original file
Hope this helps
0
I need to do it for a large number of files
0
In that case maybe in A loop. But then this is not a good solutions because it would take too much time