Good day,
Indeed, you are dealing with quite a complex situation, but it's not impossible to manage. By using a script-based approach, you can extract components of long file names into custom metadata properties. Here's a simplified guide using PowerShell, an automation framework designed for Windows:
Before you start, please ensure you have a backup of your data as this process will change file names.
1. Open a PowerShell terminal.
2. Navigate to the folder that contains your files, using the "cd" command.
Then, we'll run a script that will shorten the file names and add the excess information to custom properties for each file:
Code:
# Get the list of files in the folder
$files = Get-ChildItem -File
foreach ($file in $files){
# Extract the ID from the filename, you may need to adjust this based on your actual format
$id = $file.BaseName -replace '^.*ID (\d+).*$', '$1'
# Set the new filename to the ID
$newFileName = $id + $file.Extension
# Extract the name components
$nameComponents = $file.BaseName -replace 'ID \d+.*$', ''
$nameComponents = $nameComponents.Trim()
# Set the nameComponents into custom property
$shell = New-Object -ComObject Shell.Application
$folder = $shell.Namespace((Resolve-Path $file.DirectoryName))
$shellfile = $folder.ParseName($file.Name)
# '21' is generally for comments but you can choose a custom property based on your requirement
$folder.GetDetailsOf($shellfile, 21) = $nameComponents
# Rename the file
Rename-Item -Path $file.FullName -NewName $newFileName
}
This script extracts the ID from each filename and sets it as a new filename while trimming the original one. It also retrieves the remaining part of the original filename (the person's names) and stores it as a custom property for the file (using 'Comments' as an example field).
Please customize the PowerShell script according to your needs. Test it with a subset of files first, as this script will modify your original files. If the existing script doesn't provide the desired output, I would strongly recommend soliciting the assistance of a professional programmer to precisely tune the script to your needs.
Remember, this is just part of the process. Once this operation is completed, you'd need to check how these updated files with their metadata are migrated using your migration tool. It might need customization there as well to ensure the metadata follows along during the migration.