We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
File Import (Read 733 times)
File Import
Jul 2nd, 2008, 6:31am
 
This question pertains to extracting pertinent information on a file import. I'm new to programming and this issue has given me headaches.

For starters, how would I be able to display a targeted row of information from a txt file (or tsv) in Processing? Let's say that row of information contains the daily high temperatures for Denver, CO, Monday - Sunday. Taking it a step further, how would I be able to limit the information an end user asks for (say the user only wants to see the high temp. on Monday)?


any help would be greatly appreciated.
Re: File Import
Reply #1 - Jul 2nd, 2008, 12:14pm
 
First, take a look on this:

http://processing.org/reference/loadStrings_.html

and then each line you can split and extract data using split() or splitTokens() function, as is in:
http://processing.org/reference/split_.html

to display you can use either println() function, or if you want to display in drawing area you can use functionality described in:
http://processing.org/reference/text_.html

Re: File Import
Reply #2 - Jul 4th, 2008, 3:30am
 
Maybe this Post will help you. I had some similar questions :

http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Programs;action=display;num=1212645481;start=1
Page Index Toggle Pages: 1