Re: freebcp -c and newlines
| Newsgroups | gmane.comp.db.tds.freetds |
|---|---|
| Message-ID | <[email protected]> |
The vendor tools behave in the same way as freebcp, so in some respects it would be better to keep it "as is". Most people simply use the column separator and row separator options to get round this and if you get it wrong it usually fails part way through the "bcp in" with an error anyway. I usually use grep to check the file for separators I'm considering using. However, improving on what the vendors do without breaking compatibility seems like a good idea. So if the bcp out checks to make sure the data doesn't contain the separators and it doesn't slow it down then I'm all for it. Hope you'll excuse my "thinking out loud" style of reply! Matthew. August 7 2015 9:15 AM, "Ed Avis" <[email protected]> wrote: > freebcp -c writes rows in a simple text format with a newline character at > the end of each row. But if one of the columns itself contains a literal > newline the output will be corrupt. It would be better for freebcp -c to > check for newlines when writing data, and exit with an error status if it > finds one. Probably it should also check for the separator character. If > you want to write arbitrary data to a file you should use the binary bcp > output format. > > If you agree that this would be a useful safety check to prevent corrupt > output, I could submit a patch. > > -- > Ed Avis <[email protected]> > > _______________________________________________ > FreeTDS mailing list > [email protected] > http://lists.ibiblio.org/mailman/listinfo/freetds