This week's book giveaway is in the Security forum.
We're giving away four copies of Securing DevOps and have Julien Vehent on-line!
See this thread for details.
Win a copy of Securing DevOps this week in the Security forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

read line by line from file  RSS feed

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!