Comments (11)
Yes. CsvHelper follows RFC 4180. It supports line ending of \r\n, \r, and \n.
from csvhelper.
@JoshClose , I'm finding my csv is treating carriage returns as new rows of data. Any suggestions on how to address this?
from csvhelper.
Are you saying CsvReader reading it improperly? Or CsvWriter is writing it improperly? Or something else?
from csvhelper.
I'm using CsvWriter with a StringWriter.
from csvhelper.
If you're opening it up in a text editor, the formatting is going to be as you'd expect. Take a look over RFC 4180; it's a short read. https://tools.ietf.org/html/rfc4180
If a field has a carriage return in it \r\n
, then the field must be escaped by putting quotes around it "1\r\n2"
. The data you have is showing the field with the break has quotes around it.
Opening up in a text editor is going to format it as text, so the breaks will break. Try opening it up in Excel and you'll probably see it more as you're expecting.
from csvhelper.
I've found opening directly in Excel won't read special characters likes trademarks. I have to import the data and select a file origin for UTF-8. On import, it then reads the carriage returns as new lines. I can't determine a resolution to address both issues.
from csvhelper.
What is your goal? It looks like the data is being written correctly based on RFC 4180 (from what I can see). What needs to happen to the data after it's in CSV format?
from csvhelper.
It needs to be accessed in Excel, then is merged with other data by my user who then imports all the data into cvent...for seminar registrations.
from csvhelper.
It should open in Excel fine. You may have to set some options in Excel when opening or importing. You may need to specify a specific encoding too for all I know. Obviously, use the encoding that you used to write the CSV. CsvHelper doesn't do anything with encodings; it just uses the TextWriter you give it.
from csvhelper.
I'm not on a computer that I'm able to test anything out unfortunately. If you need some help, you can email me a sample text file, and I can give it a try with Excel tonight some time.
from csvhelper.
Thanks so much! Sending email now.
from csvhelper.
Related Issues (20)
- Schema validation
- Unable to set datetime format for reading csv data HOT 3
- double datatype is being written to csv with ' prepended to string HOT 7
- Globally turn off date/time conversion to local, always use UTC HOT 6
- [Feature] Deserialise into named tuple
- Custom Type Converter page should include an example of using type converter constructor arguments
- Microsoft.Bcl.AsyncInterfaces dependency issue HOT 9
- Unexpected behaviour when using multiple character newline HOT 2
- Add ability to read empty string as 0 (or other default value) for non-nullable types
- Skip rows from csv file arbitrary rows HOT 4
- CsvDataReader - cant read with columnName when using custom SchemaTable HOT 3
- CountBytes does not correctly count bytes when IgnoreBlankLines is enabled. HOT 1
- Incorrect array length determination in ByteArrayConverter.HexStringToByteArray
- Build error - HOT 3
- New compatibility issue regression due to `System.Linq.Async` inclusion HOT 5
- Microsoft.Bcl.AsyncInterfaces dependency error on System.Threading.Tasks.Extensions HOT 4
- ConfigurationException: 'Types that inherit IEnumerable cannot be auto mapped' when using custom class based on DynamicObject (NOT ExpandoObject) which also implements IDictionary HOT 3
- Missing "Product Version" in CsvHelper.dll HOT 1
- Column Name not displaying Using Mapping HOT 1
- Just thrown new exception by choice.
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 csvhelper.