FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Programming Questions & Help
   Syntax
(Moderators: fry, REAS)
   conditional data  storing using loadstrings
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: conditional data  storing using loadstrings  (Read 321 times)
Jean-Jacques

WWW
conditional data  storing using loadstrings
« on: Jan 14th, 2004, 1:52pm »

Thanks to Koenie i've learned how to store a text file into an array using loadstreams.
 
As my .txt file is in fact an html file now i would like to store into an array just the text and not the html tags.
 
Is it possible to use regular expressions ?
 
Is there another to way to accomplish this ?
 
Thanks !
 
 
Jean-Jacques

WWW
Re: conditional data  storing using loadstrings
« Reply #1 on: Jan 14th, 2004, 2:59pm »

Apparently in the reference there's this about array:
 
"The data at this location can be defined with the syntax array[element] = value or read with the syntax value = array[element].
 
Is it a way ?
 
Koenie

170825270170825270koeniedesign WWW Email
Re: conditional data  storing using loadstrings
« Reply #2 on: Jan 14th, 2004, 4:18pm »

I guess using regular expressions is a good idea. Some code to get started:
 
Code:
String nonFormattedString = "bad always wins, because bad rules";
String formattedString = nonFormattedString.replaceAll("bad", "good");
println(formattedString);

Koenie
 

http://koeniedesign.com
Jean-Jacques

WWW
Re: conditional data  storing using loadstrings
« Reply #3 on: Jan 14th, 2004, 7:43pm »

Thanks Koenie !
 
In order to developp my self-Help habbits with processing i would like to know how did you find something about .replaceAll ?
 
because i searched the website for replaceall and i fund nothing excepted your last answer.
« Last Edit: Jan 14th, 2004, 7:45pm by Jean-Jacques »  
Bijeoma

myloveiloved
Re: conditional data  storing using loadstrings
« Reply #4 on: Jan 14th, 2004, 8:28pm »

replaceall is a method (function) of the string class. you can find all java's classes and the classe's methods here: http://java.sun.com/j2se/1.4.2/docs/api/
 
bryan
 
« Last Edit: Jan 14th, 2004, 8:30pm by Bijeoma »  
Jean-Jacques

WWW
Re: conditional data  storing using loadstrings
« Reply #5 on: Jan 14th, 2004, 9:26pm »

thanks for all your advices.
I'm soo happy to learn !
 
Jean-Jacques

WWW
Re: conditional data  storing using loadstring
« Reply #6 on: Jan 14th, 2004, 9:31pm »

this is the link about the class string
http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html
 
Jean-Jacques

WWW
Re: conditional data  storing using loadstrings
« Reply #7 on: Jan 14th, 2004, 9:41pm »

this is the precise link to regular expressions
http://java.sun.com/j2se/1.4.2/docs/api/java/util/regex/Pattern.html#sum
 
Wow it seems a bit complicated !
 
Pages: 1 

« Previous topic | Next topic »