[GNC] - File Path for associated files

Adrien Monteleone adrien.monteleone at lusfiber.net
Tue Sep 11 23:49:35 EDT 2018


Perhaps someone else who’s come across this might offer some tips, but here’s how I’d approach it:

Your data file (if using the default backend) is just an XML file that is compressed.

Uncompress it (with tar) and use either your favorite text editor or sed command to conduct a find&replace.

If you’re using one of the SQL backends, you can run an UPDATE command to replace the given text. (research this command well for your particular backend before proceeding)

You only need to replace the “G:/documents” or whatever you used part of the file path, not the actual pdf file name. If the bulk of the path is the same as before, just say mounted on /media instead of G:/ then you only need to replace “G:” with “/media” (the slash left over after “:” will continue the path)

In any case, I’d work on a copy of your data file and then check it out to make sure everything is fine. Then perhaps store the non-modified copy as an extra backup just in case you find a problem down the road.

Don’t forget to change your default path in GnuCash preferences.

Regards,
Adrien

> On Sep 11, 2018, at 7:00 PM, John Sears via gnucash-user <gnucash-user at gnucash.org> wrote:
> 
> When using the associate files function  for a transaction within
> GNUCash on Windows, I stored all of my pdfs on an  external USB/ SD
> card. Windows  mapped this address  with a letter, G, in this case.  ( I
> also store my accounts on this same card now)
> 
> So my files were all stored on G:/documents/xxx.pdf
> 
> Now that I have transferred to Linux, this path is not recognised - "
> GNUCash could not open the associated URI: file:///G:/documents/xxx.pdf"
> 
> Is there a way to bulk edit the paths of all the  links so that Linux
> will recognise  the SD path?  I would prefer not to go  into every
> single transaction to do this, as I have a lot of linked files.
> 
> Or is there someway ( and this might be more of a Linux question) to map
> the SD card to the "file:///G" terminology.
> 
> Thanks!
> 
> 
> _______________________________________________
> gnucash-user mailing list
> gnucash-user at gnucash.org
> To update your subscription preferences or to unsubscribe:
> https://lists.gnucash.org/mailman/listinfo/gnucash-user
> If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
> -----
> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.




More information about the gnucash-user mailing list