Search and Replace

Plutocrat plutocrat at gmail.com
Sun Jan 3 23:53:58 EST 2016


nevyoung wrote on Monday, 04 January, 2016 11:51 AM:
> I do not S&R only the description. For example, I search for whole line
> <trn:description>X Bank Fee</trn:description> and replace it with
> <trn:description>X Bank</trn:description>.
> 
> The *.gnucash file is nearly 10 Meg in size. The editor I use is Notepad++
> and I am using a 64 bit Win8.1 computer. I just checked that Win Notepad
> running in a XP virtual machine is able to edit this file .

A couple of thoughts on Search and Replace. I used to love notepad++ when I worked on Windows (and BBEdit on Mac). I now use Jedit, which has a similar feature set. Specifically in this case the ability to do Regular Expression Search and Replace. It works on all platforms. 
http://sourceforge.net/projects/jedit/

If you find yourself doing this sort of thing a lot, then writing a script using the command line text editor 'sed' might be a worthwhile exercise. Just put a bunch of S&R terms into a script/batch file and use the -i option to edit the file "in place". eg:

sed -i 's/<trn\:description>X Bank Fee<\/trn\:description>/<trn\:description>X Bank<\/trn\:description>/g' filename.xml

P


More information about the gnucash-user mailing list