Money Mgt Calculator
[Logo] JavaRanch » JavaRanch Saloon
  Search | FAQ | Recent Topics | Hot Topics
Register / Login


Reply Bookmark it! Watch this topic JavaRanch » Forums » Mobile » Java Micro Edition
 
RSS feed
 
New topic
Author

read line by line from file

mahdi farzami
Greenhorn

Joined: Nov 21, 2009
Messages: 18

Hi , how can i read a file line by line ???
i want to save each line in slot of String array
i write this code but it`s return all of file !!!
please help me to change this code
thanks
Gopinath Karyadath
Ranch Hand

Joined: Oct 14, 2009
Messages: 51

Dear friend


String des=""
Vector vector = new Vector ();

while ((ch = isr.read()) > -1) {
buffer.append( (char) ch ) ;





des+= (String) (char) ch ;
if ( (char) ch == '\n' ) {
vector.addelements(des) ;
des = "" ;

}


}


regards
 
 
 
Reply Bookmark it! Watch this topic JavaRanch » Forums » Mobile » Java Micro Edition
 
RSS feed
 
New topic
MyEclipse Enterprise Workbench

.