Bulk File Rename files to remove or replace illegal characters - allow upload/migration to SharePoint Document Library - SharePoint Development & Administration + InfoPath

Thursday, June 18, 2009

Bulk File Rename files to remove or replace illegal characters - allow upload/migration to SharePoint Document Library

SharePoint document libraries can not store files if illegal characters exist in the file name (Illegal Characters in SharePoint (MOSS 2007) ). Migrating/uploading a large number of documents and files to a SharePoint document library can become tedious if you have to rename each file containing illegal characters each time the copy fails (or delayed write error).

To save a time and effort when migrating a large number of files, freeware bulk file renaming utilities are available which allow conditional renaming of files in a directory any sub directories.

The software I used to bulk rename files to remove unsupported characters prior to migrating to SharePoint was the PFrank File Renamer, written by Peter Frankenberger. PFrank allows a series of conditions and rename actions to be performed on each file in a specified directory and any sub directories to remove or replace characters or strings from filenames. The most common is the "&" (ampersand) character, which I replaced with a space then "and" and another space. I then created a condition to replace any remaining double spaces before and after the word "and".

Once all files have been processed by the file rename utility, any illegal characters will be replaced or removed to allow a successful migration into a SharePoint document library.

When using SharePoint's Multiple File Upload interface, file names don't seem to be validated prior to the upload. If any file has an illegal character in the file name is an Access Denied page. See Access Denied when trying to upload multiple files to a SharePoint Library for more information.
Share this article:
Stumble This Delicious
Delicious
submit to reddit
Facebook
MySpace
MySpace

1 comment:

Unknown said...

Have you looked at using PowerShell to handle renaming the file names? It seems like it would be better suited to handle file name changes.

Post a Comment