Java Buffered Reader
Here's a brief desc of what my Java code does .. I'm using BufferedReader to read lines from a text files and split each line based on a predefined size...
Eg : If the 1st line of the text file is as follows
ABC12345DEF3 and i need to split it based on a size like 3,5,2,2(which i'm reading from an excelsheet)
Then my output is as follows
ABC
12345
DE
F3
I need to do this for a file with 11 lines.
Here's my code
while((line = br.readLine())!= null)
{
int lineLength = line.length();
for(int k = 0;k < lineLength;k++)
{
oldArrayVal = arr[k] + oldArrayVal;
tokens[k] = line.substring(flag, oldArrayVal);
System.out.println(tokens[k]);
sizeOfToken = tokens[k].length();
flag = oldArrayVal;
}
}
br.close();
And here's the problem I'm facing.
Only the first line is being read from the text file and displays the output as desired. Unable to read the rest of the lines within the text files.
Any help would be appreciated...
View Answers
Related Tutorials/Questions & Answers:
Buffered Reader.. - Java BeginnersBuffered Reader.. Hi Friend doubt On
BufferedReader bf=new BufferedReader(new InputStreamReader(System.in));
CAN u Please Explain the (Every....
http://www.roseindia.net/
java/
java-conversion
Java Buffered ReaderJava Buffered Reader Here's a brief desc of what my
Java code does .. I'm using BufferedReader to read lines from a text files and split each line based on a predefined size...
Eg : If the 1st line of the text file
Advertisements
JSP Buffered Reader
JSP
Buffered Reader
JSP
Buffered Reader allows the user... illustrate an example from 'JSP
Buffered Reader'. To grasp and
understand
Java I/O Buffered StreamsJava I/O
Buffered Streams
In this section we will discuss the I/O
Buffered Streams.
In
Java programming when we are doing an input and output operation... these are as follows :ADS_TO_REPLACE_1
Video: How to use
Buffered Streams in
Java Java file byte readerJava file byte reader I am looking for an example program in
Java for reading the bytes. More specifically I need
java file byte
reader example code.
Thanks
For complete details read the following tutorials:
Java Java IO ReaderJava IO
Reader
In this section we will discuss about the
Reader class in
Java.
Reader class is an abstract class in java.io package provided for reading...
Constructor Name
Description
Reader()
This is a default constructor
barcode reader using java scriptbarcode
reader using
java script Hai all,
I need code for one application in
java and
java script
my requirement is,
Scanning data directly into a field is the easiest of all implementations. The cursor is placed
Barcode readerBarcode reader hi all, i wont to operation in the out put from Barcode
reader.
dose
java support Barcode
reader`s result
How to convet reader to double? - Java BeginnersHow to convet
reader to double? I have this set of coding which read the input from the com1 port. I wan to ask how to convert the input (the
reader.../a")) {
SimpleRead
reader = new SimpleRead