Newbie Seeking Advice

64 views
Skip to first unread message

Mark Love

unread,
Feb 29, 2020, 12:58:30 PM2/29/20
to BBEdit Talk
I don't own BBEdit (yet) but think it could solve a problem I have.

PROBLEM:

My credit card company has recently switched the semantics of the QFX file it produces to describe transactions. (For those not familiar with QFX, it's SGML based descriptions of financial activity).  Anyway, when it worked properly charges to the card were described thusly:

TRNTYPE=DEBIT
TRNAMT=<negative currency>

and payments to the credit card company and merchant refunds were coded as:

TRNTYPE=CREDIT
TRNAMT=<positive currency>

A recent change to the generated GFX file semantics prevents me from importing it into my personal finance software:  all charges come through as payments and all payments come through as charges.  The root cause is this new encoding in the QFX for charges:

TRNTYPE=CREDIT
TRNAMT=<positive currency>

and for payments:

TRNTYPE=DEBIT
TRNAMT=<negative currency>

As you can see, it's just the opposite from what it used to be!!!

The credit card company insists this is correct (confirming that both Quicken and MS Money say they're OK with the change).  But it broke Banktivity, and from spending over 6 hours on the phone with both companies, I expect my only chance to solve this problem is with text manipulation.  Thus my interest in BBEdit.

There seems to be some sort of automation capability in BBEdit where I could run a series of transforms on the QFX file as delivered by the credit card company before importing into Banktivity.  Is this true, and can someone describe the BBEdit commands to transform the QFX file properly?  Here's my take on the automation flow:

  • open a specified file
  • change all occurrences of CREDIT to XXX
  • Change all occurrences of DEBIT to CREDIT
  • Change all occurrences of XXX to DEBIT
  • <I'm not sure how to transform the TRNAMT values in sign only (basically, multiplying by -1)>
  • Close transformed file
Any help provided would be greatly appreciated.  BBEdit is clearly overkill for my problem, but for 50-odd bucks it seems worthwhile to me to kill this aggravation.

My environment:  MacOS High Sierra (10.13.6) running on a MacBook Pro early 2011 (to be upgraded this summer to Catalina on a MacBook Pro 16").

Thanks again.

Mark

David G Wagner

unread,
Feb 29, 2020, 2:42:43 PM2/29/20
to BBEdit Talk
What do the currency numbers look like? I mean is there a dollar sign? Is the minus sign at front or back?

What you want to do is simple, but not familiar SGML.

So if you can dummy some trans, would make it clearer to me... 

Wags ;)
WagsWorld
Hebrews 4:15
Ph(primary) : 408-914-1341
Ph(secondary): 408-761-7391
--
This is the BBEdit Talk public discussion group. If you have a feature request or need technical support, please email "sup...@barebones.com" rather than posting here. Follow @bbedit on Twitter: <https://twitter.com/bbedit>
---
You received this message because you are subscribed to the Google Groups "BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bbedit+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bbedit/bc0dc03d-3b93-4bb4-bf9f-da0a5f436237%40googlegroups.com.

Patrick Woolsey

unread,
Feb 29, 2020, 3:16:01 PM2/29/20
to bbe...@googlegroups.com
That is indeed correct: you can create a _text factory_ and use that to apply multiple transformations, such as the 'Replace All' action, to any desired set of files.

To get you started:

Choose File -> New -> Text Factory to create a new text factory, and save the text factory file to any convenient place (e.g. to your desktop, or into the "Scripts" folder of BBEdit's app support folder).

Then, in the text factory window, choose your first desired action from the popup menu (the default action is "Change Case" but you'll want to use "Replace All") and set its options, then click the plus (+) button to add another action and set its options, etc.

Once you've added all the necessary actions to your factory, save it, then click the "Choose" button in the upper right corner to choose the file(s) and/or folder(s) you want to process, and click the green "Run" button at the lower right to run the text factory. (NB: The factory itself will take care of opening all the chosen files and processing their contents.)

At this point, the only remaining question is how to transform the currency values, so if you could please supply a few actual examples that would be helpful. :-)

Last but not least :-) I suggest as a normal precaution that you run the factory against either a sample file or copies of the actual file(s) involved to make sure it's doing what you want, before processing your "live" data.

[PS: For reference, you can find complete details on creating and using text factories in Chapter 5 of the included PDF manual, available at any time via Help -> User Manual.]

Regards,

Patrick Woolsey
==
Bare Bones Software, Inc. <https://www.barebones.com/>



> On Feb 29, 2020, at 10:05, Mark Love <mlov...@gmail.com> wrote:
>
> [...]

Mark Love

unread,
Feb 29, 2020, 4:48:13 PM2/29/20
to BBEdit Talk
Thanks for the quick responses.  My answers to the inquiries for more info:

Each transaction is bound by <STMTTRN> ... </STMTTRN>

Here's an example of a CREDIT amount (new semantics - charge to card)

<TRNAMT>113.21

and a DEBIT (new semantics - payment to card)

<TRNAMT>-1432.54

As you can see, no currency indicator, no = (equals sign)

When the transform is complete, the TRNAMT values should be of opposite signs (as if they were multiplied by -1)

Thanks for your help.

Mark
To unsubscribe from this group and stop receiving emails from it, send an email to bbe...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages