how to edit ofx file with sed editor? Replace Copy FITID

Chris Good chris.good at ozemail.com.au
Mon Oct 3 19:40:14 EDT 2016


> Message: 3
> Date: Sun, 2 Oct 2016 01:33:04 -0700 (PDT)
> From: LinforPros <linforpros at gmail.com>
> To: gnucash-user at gnucash.org
> Subject: RE: how to edit ofx file with sed editor? Replace Copy FITID
> 	into NAME
> Message-ID: <1475397184114-4686874.post at n4.nabble.com>
> Content-Type: text/plain; charset=us-ascii
> 
> Hello, thank you for the script. I appreciate the time you expended to
write
> it.
> It does not produce any visible changes in my computer on files being
> processed.
> 
> INPUT september2016.ofx
> OUTPUT septermber016converted.ofx
> THE SCRIPT awkconvert_gwb.awk
> 
> I did the following:
> awk -f awkconvert_gwb.awk september2016.ofx >
> september2016converted.ofx
> 
> 
> and then checked if NAME has been populated with FITID line (just the
> portion after the double **):
> 
> $cat septermber016converted.ofx
> [...]
> <STMTTRN>
><TRNTYPE>CREDIT
> <DTPOSTED>20160929000000[-6:CST]
><TRNAMT>38.90
> <FITID>20160929000000[-6:CST]*38.90*542**160929P2 Square Inc CCD
L202157288906
> <NAME>160929P2 Square Inc CCD L2021572
> </STMTTRN>
> <STMTTRN>
> <TRNTYPE>POS
> <DTPOSTED>20160928000000[-6:CST]
> <TRNAMT>-26.35
> <FITID>20160928000000[-6:CST]*-26.35*13**POS DEB 1922 09/27/16 00478770
SHELL Servi$
> <NAME>POS DEB 1922  09/27/16 00478770 S
>  </STMTTRN>
> [...]
> 
> So for now I have no clue where to start.
> I tried "awk --help" and did this:awk -D awkconvert_gwb.awk
> awk: cmd. line:1: awkconvert_gwb.awk
> awk: cmd. line:1:               ^ syntax error
> 
> 
> But I am not sure whether the option -D should serve the purpose of
> checking
> the script..
> 
> If you could follow up on the issue I would be greatful (which of course
> stil does not give you any profits.... :-) )
> 
> regards
> Lin
> 
> View this message in context: http://gnucash.1415818.n4.nabble.com/how-
> to-edit-ofx-file-with-sed-editor-Replace-Copy-FITID-into-NAME-
> tp4686543p4686874.html
> Sent from the GnuCash - User mailing list archive at Nabble.com.

Hi Lin,

To me, it seems to be doing what you asked for, so I guess I don't
understand what you want.
Please clarify and provide an example?

There is no -D  argument that awk understands (at least any awk that I know
of). Try 'man awk' to see the manual page.

Regards, Chris Good
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4817 bytes
Desc: not available
URL: <http://lists.gnucash.org/pipermail/gnucash-user/attachments/20161004/8bd7ef29/attachment.p7s>


More information about the gnucash-user mailing list