Comments (3)
This is working as expected. The Escaped
mode parser only expects delimiters, newlines and escape characters to be escaped. Yes, it is similar to C-style string literal escaping, but is not exactly the same. The test-cases that you provide are invalid, as a
doesn't need to be escaped, so a \a
sequence is invalid. I've made the design decision to simply remove the unnecessary escape character. If you want a bell (\a
) character, or a tab (\t
) character, you can simply include that character in the output stream without needing to escape it.
from sylvan.
Agreed on characters like tab and bell not needing escaping for the format to output correctly. The designer of the application that creates the files I'm consuming unfortunately decided to escape every character anyways and isn't open to changing the behavior since the choice was made over 25 years ago.
That said, the newline characters \r and \n were also not working in my tests. A CSV line like
Hello,A\r\nB
would result in parsing to
"Hello"
"ArnB"
field values, instead of
"Hello"
"A
B"
The newline character parsing was primarily where I was encountering issues. I don't think any of the data from this application will seriously include the bell character, but I included it to try and be comprehensive.
from sylvan.
After having my coffee I realize you said the design accommodates newlines by using the escape character followed by the actual newline character itself and not the C-style escape. Sorry about that.
from sylvan.
Related Issues (20)
- Configuration adjustments for CSV parsing HOT 1
- Records Count and Max Length of each Column HOT 1
- A 19kb record throws CsvRecordTooLargeException HOT 3
- Fields ending in escaped character return the wrong character HOT 1
- Minor unescape issue? HOT 2
- CompiledDataBinder: "Body of catch must have the same type as body of try" exception HOT 7
- Bulk Load CSV data into Postgres? HOT 1
- DbDataReader reads all rows as empty from IEnumerable<object> HOT 5
- The ObjectDataReader should use DataMember attribute to allow column name mapping HOT 1
- Encoding problem HOT 3
- DataTable Columns and Rows HOT 3
- Reading many csv files, checking the length of fields and merging them all into one file HOT 3
- CsvWriter to output to a .gz file HOT 1
- Invalid Examples for CSV Data Binding HOT 2
- CSV: RowNumber and line breaks inside fields HOT 1
- nullables issue, how to get the property names, and type info HOT 1
- Query: Nullable boolean CsvDataWriterOptions FalseString HOT 4
- Unable to provide custom FieldAccessors for use with a CsvSchema HOT 2
- No TimeSpan support in Schema.Parse() HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sylvan.