Read the data in the txt file for calculation.

Source: Internet
Author: User

I found a problem on the Forum about reading the data in the txt file for computation.



Try to solve this problem and obtain the floating point data of X and Y in each row.
Read each line of the text file to determine whether it is a blank line or whether the two values are separated by the separator. Each value is of the double type, that is, the data we need to obtain.

Store the data in a local file with the name data.txt.

2166.631652045891,-example,-77.8577902454422.167.583618151274,-example,-example,-77.4629782976242167.109696002005,-example, -77.1728092143666 View Code:


OK. We create a category to analyze and process data in text files.



In the program, the class XY written above the application:



All data is collected in List <XY> generic collection. However, Insus. NET has output to the webpage.




Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.