- Get link
- X
- Other Apps
Posts
Showing posts with the label splitTokens
Reading a text or CSV file using the Processing language
- Get link
- X
- Other Apps
In a previous post , I showed you how to export data to a text file. Now I will show you how to import it back into your Processing program. This will come in handy later on. This is what my data looks like in the text file: There are many ways to import text from a text file, and there are many ways to store the data within your code after you have imported it. Feel free to make mention of your method in the comments, however, this one definitely works, and is doing what I want it to do. I have decided to store each line within an ArrayList . The first column is stored in another ArrayList by splitting the data into bits using splitTokens . Most of the file reading code was taken from this Java site , and seems to work quite fine with the Processing programming language . I have taken bits and pieces of code from various places, and added my own flavour. Here is a snippet of the data after import. ...