Lightroom Forums

Please login or register.

Login with username, password and session length
Advanced search  

Header

Pages: [1]   Go Down

Author Topic: Batch correcting filenames / paths in a lightroom catalog  (Read 191 times)

snorcup

  • New Member
  • *
  • Posts: 2
  • Location: Pittsburgh
  • Primary OS: Windows
  • OS Version: 7
  • Memory: 4 GB
  • CPU Cores: 4
  • Video Brand: nVidia
  • LR Version: 2.5
  • Printer: Other
  • Camera: Canon
Batch correcting filenames / paths in a lightroom catalog
« on: November 20, 2009, 02:50:07 AM »
First off, I searched for this but was unable to find anything. If I am repeating an answered topic I apologize, I may have been searching the wrong keywords.

For quite some time after upgrading from Lightroom 1 to Lightroom 2, I was running both versions in parallel. For some strange reason, I was never able to get Lightroom 1 removed from my PC.

Time and time again, when I was being careless and not paying attention Version 1 would open and auto import my images. After the import was complete, I would go to open my secondary screen, and realize that I was in version 1. Afterward I would open Version 2, and re-import the images, since each version was operating off it's own catalog.

The root of the problem has been solved. I recently built a new computer, installed Windows 7 from scratch, migrated my current LR2 catalog to the new machine, and everything is good.

Searching my raw image file directory, I came to realize that EVERY photo that had a duplicate copy of the raw image was followed by "-2", for example I would have img_0055.crw, and img_0055-2.crw.

I searched my directory for file names containing "-2" and moved all of the duplicates out of my primary raw image directory to a temporary folder for safe keeping in case I needed them later.

The problem is, every one of these images in my current LR catalog points to the RAW file with -2 tacked onto the file name. Currently, I get a warning message that the original file can not be opened, I right click the image, choose show in explorer, and choose the appropriate file (IE, the same file name without the -2 on the end).

What I am looking for is an easy way to update my catalog instead of doing this image by image. If it were a standard SQL database, a simple query to find any image location that contained "-2" and remove it would take care of the issue. Is there a similar way to update the LR catalog?

Also, a mass update based on date would not be appropriate either, because at times I would open LR2 manually and do the import. As a result, images that were done with the auto import first then imported a second name contain the -2, but for the instances where I opened LR2 and started the import, the RAW files were not duplicated, and my current catalog points to the correct RAW file.

I know this is a unique, off the wall problem that I created for myself, I am just looking for an easy way out :) Also, if I explained the situation poorly I apologize. I understand the issue, it's just kinda tough to describe accurately.

If anyone has any ideas, I would love to hear them.
Logged

Victoria Bampton

  • Super Moderator
  • Senior Member
  • *
  • *
  • Posts: 6931
  • Location: Southampton, UK
  • Primary OS: Macintosh
  • OS Version: 10.6.x
  • Memory: > 4 GB
  • CPU Cores: 8
  • Video Brand: ATI
  • LR Version: 2.6
  • Printer: Epson
  • Camera: Canon
    • WWW
Re: Batch correcting filenames / paths in a lightroom catalog
« Reply #1 on: November 20, 2009, 04:47:57 PM »
It sounds like you're familiar with databases - in which case, it's a SQLite database.  If you fancy playing with a copy of your catalog, you could do.

Other than that, how easy would it be to put all the -2 files back in their right places (so that LR knows where to find the files), and then how attached are you to the original file names?  My initial thought would be to leave the -2 files where they were originally, do a batch rename to something sensible (i.e. YYMMDD-HHMMSS) and then once that had finished, it would be quite easy to remove the leftover IMG files.
Logged
Victoria

Lots of questions? Adobe Lightroom 3 Beta - The Missing FAQ Book rough cut available now!  Discount code LRF2008

Website Links: Photoshop Services - Lightroom Blog - Free Lightroom Shortcuts - Follow me on Twitter as @LightroomQueen

snorcup

  • New Member
  • *
  • Posts: 2
  • Location: Pittsburgh
  • Primary OS: Windows
  • OS Version: 7
  • Memory: 4 GB
  • CPU Cores: 4
  • Video Brand: nVidia
  • LR Version: 2.5
  • Printer: Other
  • Camera: Canon
Re: Batch correcting filenames / paths in a lightroom catalog
« Reply #2 on: November 22, 2009, 08:19:10 AM »
My raw image folder is managed by lightroom which breaks images down into a directory structure with each RAW file in a folder for the date it was taken. That was why I removed the "-2" files, since they were easy to find using a file search.

Knowing that the catalog is an SQLite database may be the hint I needed :)

Thanks for the help
Logged

sizzlingbadger

  • Lightroom Guru
  • Member
  • *
  • Posts: 807
  • Location: New Zealand
  • Primary OS: Macintosh
  • OS Version: 10.6.x
  • Memory: > 4 GB
  • CPU Cores: 2
  • Video Brand: ATI
  • LR Version: 2.6
  • Printer: Epson
  • Camera: Nikon
    • WWW
Re: Batch correcting filenames / paths in a lightroom catalog
« Reply #3 on: November 22, 2009, 08:01:08 PM »
Can you create a filter in LR so that only the images with file names like nnnnn-2.crw are selected. Then you can remove them from LR in one go.

update... just realized you need to re-point them not remove them.....

It may be easier to use something that can rename the files at the OS level to add the '-2' back in. Then you could rename in LR to get rid of the '-2'.
« Last Edit: November 22, 2009, 08:03:57 PM by sizzlingbadger »
Logged
--Nik

Owning a great violin does not make you a great violinist.
Pages: [1]   Go Up
« previous next »
 

© 2007-2010 Lightroom Forums. All rights reserved.

Adobe, Adobe Photoshop, and Adobe Photoshop Lightroom (and derivatives) are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States and/or other countries. Lightroom Forums is an independent Website not endorsed or sponsored by Adobe Systems Incorporated.

Certain content presented on this Website is copyrighted material from outside sources, and may not be reproduced, in whole or in part, without permission of the original copyright holder.

This Website is hosted by BlueHost.

Page created in 0.176 seconds with 21 queries.