QFX import problem and work around, possible bug or new feature?
Ed Reeder
ereeder at mailup.net
Tue Sep 13 18:01:44 EDT 2016
Chris,
Thanks. Your approach is much better.
One more thing that was a pain in butt for me was dealing with the
DOS/Windows shell whose quoting and escape mechanisms are quite strange
to an old UNIX guy.
20 to 30+ years ago I would have done this in my sleep :-) As it was I
was happy to get something that worked.
Take care,
Ed
On Tue, Sep 13, 2016, at 02:24 PM, Chris Good wrote:
> > Message: 1
> > Date: Mon, 12 Sep 2016 09:04:56 -0700
> > From: Ed Reeder <ereeder at mailup.net>
> > To: gnucash-user at gnucash.org
> > Subject: Re: QFX import problem and work around, possible bug or new
> > feature?
> > Message-ID:
> > <1473696296.3408818.723242841.2761EE3B at webmail.messagingengi
> > ne.com>
> > Content-Type: text/plain
> >
> > Here is an awk script to solve one QFX import problem. Hopefully this is
> to
> > the GnuCash mailing list, so that people can see it. Evidently it was not
> visible
> > where I posted it. (Thanks Derek for the heads up)
> >
> > Hope this of use to someone. I wrote a gawk script (awkqfx) that strips
> out
> > the <CATEGORY> and <MEMO>null lines. This is for DOS, Windows 10.
> > I changed the PATH variable to find both gawk and my CMD file.
> >
> > ------------------------------------------------------------------------
> > --------------------------------------
> > @ECHO OFF REM DOS CMD file that removes <CATEGORY> and <MEMO>null
> > lines from QFX files REM REM It's been twenty years since I wrote an awk
> > program, wish I remembered how to put in a null REM action so that I
> didn't
> > have the {x += 1} statements :-) REM REM Example use: awkqfx <
> > ORIGFILE.QFX > EDITEDFILE.QFX
> >
> > gawk "{if ($1 ~ /.CATEGORY./) {x += 1} else if ($1 ~ /.MEMO.null/) {x +=
> 1}
> > else print $0}"
> >
>
> Hi Ed,
>
> You can use 'next' instead of dummy 'x +=1' in this case.
> I suggest:
> awk '
> /^<CATEGORY>/ { next }
> /^<MEMO>null/ { next }
> { print }' < infile > outfile
>
> Although as you're just deleting some lines I'd probably:
> egrep -v '^<CATEGORY>|^<MEMO>null' infile > outfile
>
> Regards, Chris Good
> Email had 1 attachment:
> + smime.p7s
> 6k (application/pkcs7-signature)
More information about the gnucash-user
mailing list