[Techtalk] script to change uppercase to title case in OFX/QFX
Carla Schroder
carla at bratgrrl.com
Tue Nov 29 19:19:31 UTC 2011
It is MUCH too quiet here. So here is a little problem for you fine brainiacs.
I import OFX/QFX files from my bank accounts into GnuCash, a nice time saver.
BUT. It is all uppercase, so it's like GnuCash is shouting at me, which makes
me sad. I've been trying to figure out a nice one-liner or script to convert
selected fields to title case, and so far have failed utterly. QFX is Quicken's
proprietary "enhancement" to the open OFX format; it includes some secret
magic somewhere to force institutions to pay royalties. Nice, eh? But I
digress. Both are a form of SGML, and this is what it looks like:
<STMTTRN>
<TRNTYPE>DEBIT
<DTPOSTED>20111125000000[-5:EST]
<TRNAMT>-22.71
<FITID>****
<NAME>CHESTERS THRIFTWAY JOHN
<MEMO>CHESTERS THRIFTWAY JOHN DAY OR 11-25-11 330346
</STMTTRN>
<STMTTRN><TRNTYPE>DEBIT
<DTPOSTED>20111125000000[-5:EST]
<TRNAMT>-4.56
<FITID>***
<NAME>USPS 4058720860963919 MOUNT
<MEMO>USPS 4058720860963919 MOUNT VERNON OR 11-24-11 910453
</STMTTRN>
I want the NAME and MEMO fields in title case. The tags need to be in
uppercase; I don't know if this part of the spec or a limitation in GnuCash.
Is this too much to ask? So much happiness it would bring. I have tried
various things myself and not figured out the magic that selects only the NAME
and MEMO data without changing tags or other data fields.
thanks :)
Carla
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Carla Schroder, ace Linux guru and howto author
541-932-4817 PT
carla at tuxcomputing.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
More information about the Techtalk
mailing list