How to read comma separated file




















Collectives on Stack Overflow. Learn more. How to read values from a comma separated file? Ask Question. Asked 10 years, 4 months ago. Active 10 years, 4 months ago. Viewed 49k times.

I want to read words in a text file of a line separated by commas in c sharp. ReadToEnd ; reader1. Close ; reader1. Split ",". Parse Convert. Improve this question. Arshiya Gm Arshiya Gm 63 3 3 gold badges 3 3 silver badges 7 7 bronze badges.

Is this homework? PLease show what you have tried so far, some code.. This is a solved problem. Check for libraries that parse csv files e. Add a comment. I guess the professor wanted us to learn and kill two birds with one printf statement. Add a comment. The Overflow Blog. Stack Gives Back Safety in numbers: crowdsourcing data on nefarious IP addresses. Featured on Meta. New post summary designs on greatest hits now, everywhere else eventually.

Linked Related Hot Network Questions. Stack Overflow works best with JavaScript enabled. The first few rows are shown with head.

The tail function shows the last few rows. If all of the data in the file are numeric except possibly row and column labels , then you may want to coerce the result into a matrix.

You would do that with something like:. The year was automatically selected as the row names in the example. In this case, it is a pretty good choice, but you can control which data, if any, is selected to be the row names. When you are reading data from one place to another, there is always the chance of miscommunication. The specified file does not exist FileNotFoundException. A partial-trust situation in which the user does not have sufficient permissions to access the file. The path is too long PathTooLongException.

The user does not have sufficient permissions to access the file UnauthorizedAccessException. Skip to main content. This browser is no longer supported.



0コメント

  • 1000 / 1000