madcodemonkey/CsvConverter

custom delimiter

Closed this issue · 2 comments

Hello David Y,

I was wondering there is a way to setup custom delimiter like pipe "|".

Update
Currently the answer is no. I just double checked and the SplitChar is a const. I'll try to surface this up into the configuration settings on the reader and writer services in the next few days.

Older...
No. It is currently not surfaced, but deep down in the RowBase.cs class I did create a protected property called SplitChar, which is hard coded to a comma, that could be surfaced. I have NOT done extensive testing with other delimiters, but technically it should work. If you really want to do it, you could inherit from RowReader.cs, instantiate your new class, set the protected SplitChar field to something else and then pass the instantiated instance into the constructor of the CsvReaderService (it will accept either a stream or an instance of a class that implements IRowReader).

@manoharnikkam I just created version 2.0.0.4. Now, on the reader or writer services, you can do something like this:

writerService.Configuration.SplitChar = '|';