Re: Batch editing media object paths
Peter Flynn <[email protected]>
| Newsgroups | gmane.comp.genealogy.gramps.user |
|---|---|
| Organization | Silmaril Consultants |
| Message-ID | <[email protected]> |
On 04/04/2022 18:36, Deborah Bennett wrote: > This sounds like a a job for a shell script, which would be simpler > than a python program. Have you written a shell script before? I did > a quick search and found this link which may be helpful. > https://unix.stackexchange.com/questions/121570/rename-multiples-files-using-bash-scripting > Joshua, is the problem also that the changes need to be propagated back into Gramps? Or when you say "GRAMPS reference" is this a pointer of some kind rather than the full filename? I agree with Deborah that a shell script would be simpler, but it needs to be driven by whichever is the canonical list of images: either the Gramps database, or the directories where the files live. Peter >> On Apr 4, 2022, at 10:00 AM, Joshua Herman <[email protected]> wrote: >> >> Hi everyone, >> >> Currently, my census record names are all in the following format: >> census_<year>_<country>_<province/state>_<town/city>_<head of house last >> name>_<first name>.jpg. This is causing quite a bit of redundancy, since >> there are many census records where more than one head of household appears >> in my family tree. I'd like to switch to an individual-agnostic format by >> maybe replacing the last and first names with the page number or something >> like that, but the task of going through and manually changing each media >> object's path is a bit daunting. Therefore, I'd like to know a) what format >> you all use to name census record images and b) if there is an automated >> tool to get this done for me. >> >> I'm considering creating a Python tool that takes in a .csv of the original >> file name and the desired one and updates both the file name and the GRAMPS >> reference, but if something like this already exists then I don't want to >> reinvent the wheel! Plus, I'm not very familiar with best practices when it >> comes to editing GRAMPS data programmatically, so any light shed on this >> topic is also much appreciated. >> >> Regards, >> Josh >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> >> -- >> Gramps-users mailing list >> [email protected] >> https://lists.sourceforge.net/lists/listinfo/gramps-users >> https://gramps-project.org > -------------- next part -------------- > An HTML attachment was scrubbed... > -- Peter Flynn Cork 🇮🇪 Ireland 🇪🇺 -- Gramps-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/gramps-users https://gramps-project.org