In my program I want to import csv files that only should have a pair of doubles in them. Something like:
2.2131321321, 32.321321321
3.31321321321, 65.65454545
4.12321351351, 16.13211212
Can you help finding out a safe and fast way of doing so?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The easiest way is read file line by line, split every line by
,and try to parse each part usingdouble.TryParseSimple sample, assuming that file is valid (without check):