[GNC] QFX file for Bank of American business account not

Peter West pbw at pbw.id.au
Thu May 5 04:42:34 EDT 2022


> On 5 May 2022, at 7:40 am, Jean Laroche <ripngo at gmail.com> wrote:
> 
> 
> cat stmt.qfx | sed -E "/<CARDNAME|MCC|<CARDNUM/d" > stmt_fixed.qfx
> 

For mac users:

cat stmt.qfx | gsed -E '/\<CARDNUM\>|\<CARDNAME\>|\<MCC\>/d' >stmt_fixed.qfx

This works with gsed, but not with macos sed. Getting a robust expression with macos sed is kinda messy. You’re probably better off using a perl one-liner.

cat stmt.qfx | perl -pe '$_ = "" if /\b(CARDNUM|CARDNAME|MCC)\b/‘ >stmt_fixed.qfx


—
Peter West
pbw at ehealth.id.au
Then one of them, named Cleopas, answered him, “Are you the only visitor to Jerusalem who does not know the things that have happened there in these days?”


> I'm not a sed guru, so maybe there's a better/more robust way to do it. But this should give you a temporary solution?
> 
> Jean
> 
> LibOFX ERROR: OpenSP parser: otherError (misc parse error):
> /var/folders/j6/7t8sg1vj4q97zhh9z5cdmxbm4rz935/T//libofxtmpcNQLhJ:39:13:E: element "CARDNUM" undefined
> 
> (Above message occurred on Line 39, Column 14)
>      X ERROR: startElement: incoming_data should be empty! You are probably using OpenSP <= 1.3.4.  The following data was lost: -50.00
> (Above message occurred on Line 39, Column 6)
> LibOFX ERROR: OpenSP parser: otherError (misc parse error):
> /var/folders/j6/7t8sg1vj4q97zhh9z5cdmxbm4rz935/T//libofxtmpcNQLhJ:40:14:E: element "CARDNAME" undefined
> 
> (Above message occurred on Line 40, Column 15)
>      X ERROR: startElement: incoming_data should be empty! You are probably using OpenSP <= 1.3.4.  The following data was lost: 9767
> (Above message occurred on Line 40, Column 6)
> LibOFX ERROR: OpenSP parser: otherError (misc parse error):
> /var/folders/j6/7t8sg1vj4q97zhh9z5cdmxbm4rz935/T//libofxtmpcNQLhJ:41:9:E: element "MCC" undefined
> 



More information about the gnucash-user mailing list