This PowerShell script was written by Tony Kirchgessner of The New York Botanical Garden to facilitate herbarium specimen image processing workflows and apated by David Shorthouse to suit the needs of the Canadian Museum of Nature. Specifically, this script will rename ARW image files to match derivative JPEG image files that have been renamed by the application BardecodeFiler.
The application BardecodeFiler is a barcode reading application which will rename TIF, JPEG, and PDF documents as the barcode(s) it reads in each document. Unfortunately this application does not rename ARWs.
As an example, I have created mine here: C:\Documents and Settings\tkirchgessner\My Documents\BardecodeFiler\arw
If there are too many to copy, let me know where they are and I will modify the script to find them.
$path = "E:\BardecodeFiler\output\results.csv"
Import-csv -path $path |
foreach-object `
{
$jpegfolder = $_.Folder
$arwfolder = $jpegfolder -replace "input$", "arw\"
$oldname = $_."File Name"
$oldnamearw = $oldname -replace "jpg$", "arw"
$oldfile = $arwfolder + $oldnamearw
$count = $_.Count
$barcode = $_.Value
rename-item $oldfile -newname ($barcode + '.arw')
}