Make filenames web safe
Case: I want to upload some files to a webserver, but I want all the files to be clean and web safe.
We need to use four methods to do the following:
- Make everything lowercase.
- Remove diacritics.
- Replace non-word character with - (dash).
- Replace any repeating dashes with a single dash.
Do the following:
- Add the files to the list.
- If there are methods in the method list click the Clear Methods toolbar button.
- Add New Case method and configure like this:
- New case: Lower case
- Location: All
- Apply To: Name and extension
- Add Remove method and configure like this:
- Remove type: Accents and special marks
- Apply To: Name
- Add Replace method and configure like this:
- Replace: [^a-zA-Z0-9_-]
- Replace with: -
- Occurrence: All
- Use regular expressions: Checked
- Apply To: Name
- Add Replace method again, but this time use this configuration:
- Replace: -+
- Replace with: -
- Occurrence: All
- Use regular expressions: Checked
- Apply To: Name
- Verify the names in the list and click Start Batch.