Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is Linear TSV supported? #260

Open
spektom opened this issue Jan 23, 2022 · 1 comment
Open

Is Linear TSV supported? #260

spektom opened this issue Jan 23, 2022 · 1 comment

Comments

@spektom
Copy link

spektom commented Jan 23, 2022

According to this article: https://en.wikipedia.org/wiki/Tab-separated_values#Conventions_for_lossless_conversion_to_TSV
characters \n, \t, \r and \\ should be allowed to be escaped using '' character.

Is my understanding correct, that rust-csv only allows to use \ character in context of double-quotes escaping (using csv::ReaderBuilder.escape(Some('\\')) option), or I'm missing some way to configure Linear TSV parser properly?

Thanks!

@BurntSushi
Copy link
Owner

The Wikipedia article is wishy washy here. If your second link is the true definition of "linear" TSV, then the relevant section is this:

Linear TSV provides for escape sequences, instead of quoting, so that implementations can naively split on the byte values of the separators.

Indeed, this crate does not support this. The only character you can escape is the quote character. The way to insert other special characters is to write them as literals inside of quotes.

I would be willing to add support for this option if it's a small one and opt-in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants