mentax/csv2xlsx

Delimiter can only be one character

Closed this issue · 3 comments

Hi!

I need a delimiter like |~| because the data inside the CSV could really contain all kind of characters. I cannot use just one character like | or ~.

I have seen in the code that the following is used:

delimiter := []rune(c.String("delimiter")) p.delimiter = delimiter[0]

So why not using the following?

delimiter := []rune(c.String("delimiter")) p.delimiter = delimiter

DeyV commented

Because delimiter must be rune, as is in csv.Reader.Comma

As always - you can use " or ' for quoting strings in csv

Surrounding with " or ' is difficult because the strings are containing " or ' as well. I will clean up the records beforehand, to provide something more valid.

DeyV commented