Re: freebcp adding escaping
Frediano Ziglio <[email protected]>
| Newsgroups | gmane.comp.db.tds.freetds |
|---|---|
| Message-ID | <CAHt6W4c=8=i=bV-dT8MXwnShW3hwLQ=nM6KSpPzDm4PZSh6U2g@mail.gmail.com> |
2016-02-03 4:40 GMT+00:00 Andrew Punch <[email protected]>: > Hi, > > I had a requirement to have properly formatted CSV output from freebcp. > Unfortunately freebcp (and the original bcp) do not escape characters > correctly. For example in a comma delimited file commas will not be escaped. > Also the way NULLs are indicated can be inconvenient. > > I hacked together a patch which I have attached. I would like to do a pull > after a clean up but I have a few questions: > > 1. is dblib the best place to make the change? > 2. what is the best structure to pass parameters and flags? Namely: > 1. Flag for delimiter escaping > 2. The actual delimiter (I notice that the column delimiter changes > to EOL for the last column) > 3. Flag for NULL string replacement (instead of ASCII NUL) > 4. NULL string replacement > Sorry for late reply. Honestly looks quite weird to change freebcp. freebcp use a format which is quite similar to normal bcp utility. I would honestly change tsql instead. Frediano