Closed adamdecaf closed 1 year ago
@zbruhnke do you have an example for ACH?
I think this is best solved with a ValidateOpts
field for a prefix to strip off each line. Functions cannot be serialized across json/yaml so we can't implement a generic routine.
Should we have an array of prefixes to trim?
I assume this is only for the file reader and not JSON? Is this something that should be configurable or is there static vars that we can iterate over to avoid? I am sure we could put some logic in the Reader https://github.com/moov-io/ach/blob/master/reader.go#L114 or here https://github.com/moov-io/ach/blob/364497ec3bfe3928ac298ef436050ba9eb87dc48/reader.go#L160
This is only for the Nacha format. It was a vendor applying a prefix, but the original reporter of this issue trimmed the files prior to parsing.
I don't know if this belongs in the library or not. It seems like a stretch to include strings.TrimPrefix(...)
functionality when it can be easily called outside of moov-io/ach.
Should we close the ticket then?
On Fri, Dec 16, 2022, 3:34 PM Adam Shannon @.***> wrote:
This is only for the Nacha format. It was a vendor applying a prefix, but the original reporter of this issue trimmed the files prior to parsing.
— Reply to this email directly, view it on GitHub https://github.com/moov-io/ach/issues/1037#issuecomment-1355736208, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAIBXNPR2PAHDR5JZDOGU3WNTVBDANCNFSM52Z6IL2Q . You are receiving this because you commented.Message ID: @.***>
ACH Version:
v1.18.1
What did you see? Vendors sometimes prefix lines with custom data that needs to be removed. Files and records are in Nacha format except for this prefix.
What did you expect to see? A handy way to strip these prefixes would help projects like ACHGateway to process these.