Page 1 of 1

Passing in alternate field delimiters.

Posted: Mon Apr 03, 2023 1:24 pm
by bozeyed_joe
Hi Scott,

We were just wondering is there a parameter that be set to use a different field delimiter on your CSVINTO parser?
We have a number of files incoming that use Pipe rather than Comma.

Many thanks in advance.
Mick

Re: Passing in alternate field delimiters.

Posted: Mon Apr 03, 2023 1:33 pm
by Scott Klement
Currently, no... it always uses a comma.

You can edit the CSVINTO program and change it here:

Code: Select all

      h = CSV_openBuf( parm.data: parm.dataLen: parm.dataCCSID
                     : *omit: *omit: *omit: *on );
Change it to:

Code: Select all

      h = CSV_openBuf( parm.data: parm.dataLen: parm.dataCCSID
                     : *omit: *omit: '|': *on );
Naturally you can add the ability to set that value at run-time if you want... you'll have to modify the code to make that work, it's something I've not had a need to do. If you feel that you've done a particularly nice job of it, please contribute it back to the project (post your changes here) so that others can take advantage of it.

Re: Passing in alternate field delimiters.

Posted: Mon Apr 03, 2023 1:56 pm
by bozeyed_joe
Hi Scott,

Okay thanks for the pointer.
I will take a look.

Cheers
Mick