Destination File in CSV import

Started by Hbar, August 17, 2016, 01:22:59 PM

Previous topic - Next topic

Hbar

Hello,

I am creating an excel tool to reorganise collections of scans using vba and exiftool. In my managed to get my program working with csv files to export and import tags.

The purpose is to completely reorganise my collections of many tenthousands of scans (all cadaster maps from 1842 onwards for Belgium and Dutch Limburg). This involves creating tags and renaming files, using serveral look-up tables. For the latter I am using Excel: I read tags from the existing files in one Excel table and from this I create a second table with the new tags ,the new filenames and a completely different directory structure.
This all works great with exiftool and Excel, except that I am looking for an efficient way to rename the files.

In the csv files there is the SourceFile, but I am looking for a DestinationFile in vane. Am I missing something? Without this, the processing would be tedious: copying and rename the files, add the tags and delete the "TIFF_original"s, involving TBytes.

Any suggestions?

Phil Harvey

I think that reading FAQ 12 may help here.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Hbar

Sorry Phil,

I might not understand the depth of FAQ 12, but I have no problem to export the information into a database (in my case Excel) nor to import the information from the database (FAQ 26).

My problem lies in the fact that I would like to import AND RENAME the image files. I have seen simple rename capabilities e.g. with %Y and %M but this is not sufficient for me. What I am looking for is something like a DestinationFile in the csv, similar like the SourceFile.

I tried to clarify this in the attachement.

Hope you can help.

Best regard
Harrie Bär

StarGeek

From the docs:
"FileName and Directory columns are ignored if they exist"

So you can't rename directly from a CSV.  The question becomes how complicated is the formula that you use to create the destination name.  It could be possible to create the destination filename either through the advanced formatting or a user defined tag if it could be based upon info that's already in the file.  Remember, you have the full power of the Perl language available.

But I think the easier answer would be a two step solution.  First, write the DestinationFile into a tag you don't use, along with all your other tags from the CSV.  Title would be a good example, as I believe that is normally the place you would write the file name.  Then, you could rename all the files by using exiftool "-filename<Title" DIR.  You could then clear out the Title if you like.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

Hbar

Thank you very much for the suggestion.

It is a pity it cannot be done in the CSV as it would be far more efficient. But no problem, I will then use vba in Excel to do the job.

Thanks again for your quick help.

Best regards,
Harrie Bär