How To Draw Random Lines From File Java
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster
Ezzaral ii,714 Posting Sage Team Colleague Featured Poster
readLine() but sequentially reads lines from the file. If you only care well-nigh certain lines, maintain a counter as the lines are read and print/store/whatever lines you lot need based upon that counter.
int lineNumber=0; Cord line=null; while ( (line = br.readLine()) != naught){ lineNumber++; if ( <some expression on lineNumber> ){ // do something } }
Ezzaral two,714 Posting Sage Squad Colleague Featured Poster
Lioshenka
~s.o.south~ ii,560 Failure as a homo Team Colleague Featured Poster
~s.o.southward~ two,560 Failure every bit a human being Team Colleague Featured Poster
I am non quite sure that I sympathise what you lot are trying to say hither but if you are worried about the number of characters displayed per line on your console window, information technology depends on the properties of the console window (OS specific) and has got nothing to practice with your programme. For e.thou. in Windows you can set the properties of the console window similar Screen buffer and window size to increase / display the number of characters displayed.
If still in doubt, post the code forth with the varying output you are talking nigh.
~s.o.s~ 2,560 Failure equally a human Team Colleague Featured Poster
Source: https://www.daniweb.com/programming/software-development/threads/110393/how-to-output-random-line-from-a-file
Posted by: lopezdresse.blogspot.com
0 Response to "How To Draw Random Lines From File Java"
Post a Comment