Java Buffered Reader

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 Beginners
Buffered 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 Reader
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
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 Streams
Java 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 reader
Java 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 Reader
Java 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 script
barcode 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
ModuleNotFoundError: No module named 'buffered-smtp-handler'
ModuleNotFoundError: No module named 'buffered-smtp-handler'  Hi...: No module named 'buffered-smtp-handler' How to remove the ModuleNotFoundError: No module named 'buffered-smtp-handler' error? Thanks   Hi
Barcode reader
Barcode 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 Beginners
How 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
Maven dependency for eu.rssw.openedge.rcode - rcode-reader version 2.14.8 is released. Learn to use rcode-reader version 2.14.8 in Maven based Java projects
-reader version 2.14.8 ) in their Java project if it is based on Maven and Gradle...? Steps to use  eu.rssw.openedge.rcode - rcode-reader version 2.14.8 in Java... - rcode-reader version 2.14.8 java library in your project. ADS_TO_REPLACE_2 Now
Maven dependency for eu.rssw.openedge.rcode - rcode-reader version 2.14.7 is released. Learn to use rcode-reader version 2.14.7 in Maven based Java projects
-reader version 2.14.7 ) in their Java project if it is based on Maven and Gradle...? Steps to use  eu.rssw.openedge.rcode - rcode-reader version 2.14.7 in Java... - rcode-reader version 2.14.7 java library in your project. ADS_TO_REPLACE_2 Now
Maven dependency for eu.rssw.openedge.rcode - rcode-reader version 2.14.6 is released. Learn to use rcode-reader version 2.14.6 in Maven based Java projects
-reader version 2.14.6 ) in their Java project if it is based on Maven and Gradle...? Steps to use  eu.rssw.openedge.rcode - rcode-reader version 2.14.6 in Java... - rcode-reader version 2.14.6 java library in your project. ADS_TO_REPLACE_2 Now
Maven dependency for eu.rssw.openedge.rcode - rcode-reader version 2.14.1 is released. Learn to use rcode-reader version 2.14.1 in Maven based Java projects
-reader version 2.14.1 ) in their Java project if it is based on Maven and Gradle...? Steps to use  eu.rssw.openedge.rcode - rcode-reader version 2.14.1 in Java... - rcode-reader version 2.14.1 java library in your project. ADS_TO_REPLACE_2 Now
Maven dependency for eu.rssw.openedge.rcode - rcode-reader version 2.13.0 is released. Learn to use rcode-reader version 2.13.0 in Maven based Java projects
-reader version 2.13.0 ) in their Java project if it is based on Maven and Gradle...? Steps to use  eu.rssw.openedge.rcode - rcode-reader version 2.13.0 in Java... - rcode-reader version 2.13.0 java library in your project. ADS_TO_REPLACE_2 Now
Maven dependency for eu.rssw.openedge.rcode - rcode-reader version 2.11.1 is released. Learn to use rcode-reader version 2.11.1 in Maven based Java projects
-reader version 2.11.1 ) in their Java project if it is based on Maven and Gradle...? Steps to use  eu.rssw.openedge.rcode - rcode-reader version 2.11.1 in Java... - rcode-reader version 2.11.1 java library in your project. ADS_TO_REPLACE_2 Now
Maven dependency for eu.rssw.openedge.rcode - rcode-reader version 2.11.0 is released. Learn to use rcode-reader version 2.11.0 in Maven based Java projects
-reader version 2.11.0 ) in their Java project if it is based on Maven and Gradle...? Steps to use  eu.rssw.openedge.rcode - rcode-reader version 2.11.0 in Java... - rcode-reader version 2.11.0 java library in your project. ADS_TO_REPLACE_2 Now
Maven dependency for de.adorsys.psd2 - json-reader version 13.1 is released. Learn to use json-reader version 13.1 in Maven based Java projects
this version ( de.adorsys.psd2 - json-reader version 13.1 ) in their Java...-reader version 13.1 in Java projects. Follow the step by step tutorial for using...Maven dependency for  de.adorsys.psd2  - Version 13.1 of json-reader
Maven dependency for de.adorsys.psd2 - json-reader version 12.3 is released. Learn to use json-reader version 12.3 in Maven based Java projects
this version ( de.adorsys.psd2 - json-reader version 12.3 ) in their Java...-reader version 12.3 in Java projects. Follow the step by step tutorial for using...Maven dependency for  de.adorsys.psd2  - Version 12.3 of json-reader
Maven dependency for de.adorsys.psd2 - json-reader version 12.2 is released. Learn to use json-reader version 12.2 in Maven based Java projects
this version ( de.adorsys.psd2 - json-reader version 12.2 ) in their Java...-reader version 12.2 in Java projects. Follow the step by step tutorial for using...Maven dependency for  de.adorsys.psd2  - Version 12.2 of json-reader
Maven dependency for de.adorsys.psd2 - json-reader version 11.11 is released. Learn to use json-reader version 11.11 in Maven based Java projects
use this version ( de.adorsys.psd2 - json-reader version 11.11 ) in their Java...-reader version 11.11 in Java projects. Follow the step by step tutorial...-reader released The developers of   de.adorsys.psd2 - json-reader project
Maven dependency for de.adorsys.psd2 - json-reader version 11.8 is released. Learn to use json-reader version 11.8 in Maven based Java projects
this version ( de.adorsys.psd2 - json-reader version 11.8 ) in their Java...-reader version 11.8 in Java projects. Follow the step by step tutorial for using...Maven dependency for  de.adorsys.psd2  - Version 11.8 of json-reader
Maven dependency for de.adorsys.psd2 - json-reader version 11.5 is released. Learn to use json-reader version 11.5 in Maven based Java projects
this version ( de.adorsys.psd2 - json-reader version 11.5 ) in their Java...-reader version 11.5 in Java projects. Follow the step by step tutorial for using...Maven dependency for  de.adorsys.psd2  - Version 11.5 of json-reader
Maven dependency for de.adorsys.psd2 - json-reader version 11.2 is released. Learn to use json-reader version 11.2 in Maven based Java projects
this version ( de.adorsys.psd2 - json-reader version 11.2 ) in their Java...-reader version 11.2 in Java projects. Follow the step by step tutorial for using...Maven dependency for  de.adorsys.psd2  - Version 11.2 of json-reader
Maven dependency for de.adorsys.psd2 - json-reader version 10.10 is released. Learn to use json-reader version 10.10 in Maven based Java projects
use this version ( de.adorsys.psd2 - json-reader version 10.10 ) in their Java...-reader version 10.10 in Java projects. Follow the step by step tutorial...-reader released The developers of   de.adorsys.psd2 - json-reader project
Maven dependency for de.adorsys.psd2 - json-reader version 10.9 is released. Learn to use json-reader version 10.9 in Maven based Java projects
this version ( de.adorsys.psd2 - json-reader version 10.9 ) in their Java...-reader version 10.9 in Java projects. Follow the step by step tutorial for using...Maven dependency for  de.adorsys.psd2  - Version 10.9 of json-reader
Maven dependency for de.adorsys.psd2 - json-reader version 10.3 is released. Learn to use json-reader version 10.3 in Maven based Java projects
this version ( de.adorsys.psd2 - json-reader version 10.3 ) in their Java...-reader version 10.3 in Java projects. Follow the step by step tutorial for using...Maven dependency for  de.adorsys.psd2  - Version 10.3 of json-reader
Maven dependency for de.adorsys.psd2 - json-reader version 10.1 is released. Learn to use json-reader version 10.1 in Maven based Java projects
this version ( de.adorsys.psd2 - json-reader version 10.1 ) in their Java...-reader version 10.1 in Java projects. Follow the step by step tutorial for using...Maven dependency for  de.adorsys.psd2  - Version 10.1 of json-reader
Maven dependency for de.adorsys.psd2 - json-reader version 10.0 is released. Learn to use json-reader version 10.0 in Maven based Java projects
this version ( de.adorsys.psd2 - json-reader version 10.0 ) in their Java...-reader version 10.0 in Java projects. Follow the step by step tutorial for using...Maven dependency for  de.adorsys.psd2  - Version 10.0 of json-reader
Maven dependency for de.adorsys.psd2 - json-reader version 9.10 is released. Learn to use json-reader version 9.10 in Maven based Java projects
this version ( de.adorsys.psd2 - json-reader version 9.10 ) in their Java...-reader version 9.10 in Java projects. Follow the step by step tutorial for using...Maven dependency for  de.adorsys.psd2  - Version 9.10 of json-reader
Maven dependency for de.adorsys.psd2 - json-reader version 9.7 is released. Learn to use json-reader version 9.7 in Maven based Java projects
this version ( de.adorsys.psd2 - json-reader version 9.7 ) in their Java... that downloads and includes  de.adorsys.psd2 - json-reader version 9.7 java...Maven dependency for  de.adorsys.psd2  - Version 9.7 of json-reader
Maven dependency for de.adorsys.psd2 - json-reader version 8.13 is released. Learn to use json-reader version 8.13 in Maven based Java projects
this version ( de.adorsys.psd2 - json-reader version 8.13 ) in their Java...-reader version 8.13 in Java projects. Follow the step by step tutorial for using...Maven dependency for  de.adorsys.psd2  - Version 8.13 of json-reader
Maven dependency for de.adorsys.psd2 - json-reader version 8.10 is released. Learn to use json-reader version 8.10 in Maven based Java projects
this version ( de.adorsys.psd2 - json-reader version 8.10 ) in their Java...-reader version 8.10 in Java projects. Follow the step by step tutorial for using...Maven dependency for  de.adorsys.psd2  - Version 8.10 of json-reader
Maven dependency for de.adorsys.psd2 - json-reader version 8.7 is released. Learn to use json-reader version 8.7 in Maven based Java projects
this version ( de.adorsys.psd2 - json-reader version 8.7 ) in their Java... that downloads and includes  de.adorsys.psd2 - json-reader version 8.7 java...Maven dependency for  de.adorsys.psd2  - Version 8.7 of json-reader
Maven dependency for de.adorsys.psd2 - json-reader version 7.6.10 is released. Learn to use json-reader version 7.6.10 in Maven based Java projects
- json-reader version 7.6.10 in Java projects. Follow the step by step tutorial...-reader version 7.6.10 java library in your project. ADS_TO_REPLACE_2 Now you can...-reader released The developers of   de.adorsys.psd2 - json-reader project
Maven dependency for de.adorsys.psd2 - json-reader version 7.6.6 is released. Learn to use json-reader version 7.6.6 in Maven based Java projects
use this version ( de.adorsys.psd2 - json-reader version 7.6.6 ) in their Java...-reader version 7.6.6 in Java projects. Follow the step by step tutorial...-reader released The developers of   de.adorsys.psd2 - json-reader project
Maven dependency for eu.rssw.openedge.rcode - rcode-reader version 2.17.0 is released. Learn to use rcode-reader version 2.17.0 in Maven based Java projects
-reader version 2.17.0 ) in their Java project if it is based on Maven and Gradle...? Steps to use  eu.rssw.openedge.rcode - rcode-reader version 2.17.0 in Java... - rcode-reader version 2.17.0 java library in your project. ADS_TO_REPLACE_2 Now
Maven dependency for eu.rssw.openedge.rcode - rcode-reader version 2.16.0 is released. Learn to use rcode-reader version 2.16.0 in Maven based Java projects
-reader version 2.16.0 ) in their Java project if it is based on Maven and Gradle...? Steps to use  eu.rssw.openedge.rcode - rcode-reader version 2.16.0 in Java... - rcode-reader version 2.16.0 java library in your project. ADS_TO_REPLACE_2 Now
Maven dependency for eu.rssw.openedge.rcode - rcode-reader version 2.18.0 is released. Learn to use rcode-reader version 2.18.0 in Maven based Java projects
-reader version 2.18.0 ) in their Java project if it is based on Maven and Gradle...? Steps to use  eu.rssw.openedge.rcode - rcode-reader version 2.18.0 in Java... - rcode-reader version 2.18.0 java library in your project. ADS_TO_REPLACE_2 Now
Maven dependency for eu.rssw.openedge.rcode - rcode-reader version 2.18.1 is released. Learn to use rcode-reader version 2.18.1 in Maven based Java projects
-reader version 2.18.1 ) in their Java project if it is based on Maven and Gradle...? Steps to use  eu.rssw.openedge.rcode - rcode-reader version 2.18.1 in Java... - rcode-reader version 2.18.1 java library in your project. ADS_TO_REPLACE_2 Now
Maven dependency for eu.rssw.openedge.rcode - rcode-reader version 2.15.0 is released. Learn to use rcode-reader version 2.15.0 in Maven based Java projects
-reader version 2.15.0 ) in their Java project if it is based on Maven and Gradle...? Steps to use  eu.rssw.openedge.rcode - rcode-reader version 2.15.0 in Java... - rcode-reader version 2.15.0 java library in your project. ADS_TO_REPLACE_2 Now
Maven dependency for eu.rssw.openedge.rcode - rcode-reader version 2.14.10 is released. Learn to use rcode-reader version 2.14.10 in Maven based Java projects
-reader version 2.14.10 ) in their Java project if it is based on Maven and Gradle... - rcode-reader version 2.14.10 java library in your project. ADS... of rcode-reader released The developers of   eu.rssw.openedge.rcode
Maven dependency for eu.rssw.openedge.rcode - rcode-reader version 2.14.9 is released. Learn to use rcode-reader version 2.14.9 in Maven based Java projects
-reader version 2.14.9 ) in their Java project if it is based on Maven and Gradle...? Steps to use  eu.rssw.openedge.rcode - rcode-reader version 2.14.9 in Java... - rcode-reader version 2.14.9 java library in your project. ADS_TO_REPLACE_2 Now
Maven dependency for eu.rssw.openedge.rcode - rcode-reader version 2.14.5 is released. Learn to use rcode-reader version 2.14.5 in Maven based Java projects
-reader version 2.14.5 ) in their Java project if it is based on Maven and Gradle...? Steps to use  eu.rssw.openedge.rcode - rcode-reader version 2.14.5 in Java... - rcode-reader version 2.14.5 java library in your project. ADS_TO_REPLACE_2 Now
Maven dependency for eu.rssw.openedge.rcode - rcode-reader version 2.14.4 is released. Learn to use rcode-reader version 2.14.4 in Maven based Java projects
-reader version 2.14.4 ) in their Java project if it is based on Maven and Gradle...? Steps to use  eu.rssw.openedge.rcode - rcode-reader version 2.14.4 in Java... - rcode-reader version 2.14.4 java library in your project. ADS_TO_REPLACE_2 Now
Maven dependency for eu.rssw.openedge.rcode - rcode-reader version 2.14.3 is released. Learn to use rcode-reader version 2.14.3 in Maven based Java projects
-reader version 2.14.3 ) in their Java project if it is based on Maven and Gradle...? Steps to use  eu.rssw.openedge.rcode - rcode-reader version 2.14.3 in Java... - rcode-reader version 2.14.3 java library in your project. ADS_TO_REPLACE_2 Now
Maven dependency for eu.rssw.openedge.rcode - rcode-reader version 2.14.2 is released. Learn to use rcode-reader version 2.14.2 in Maven based Java projects
-reader version 2.14.2 ) in their Java project if it is based on Maven and Gradle...? Steps to use  eu.rssw.openedge.rcode - rcode-reader version 2.14.2 in Java... - rcode-reader version 2.14.2 java library in your project. ADS_TO_REPLACE_2 Now
Maven dependency for eu.rssw.openedge.rcode - rcode-reader version 2.14.0 is released. Learn to use rcode-reader version 2.14.0 in Maven based Java projects
-reader version 2.14.0 ) in their Java project if it is based on Maven and Gradle...? Steps to use  eu.rssw.openedge.rcode - rcode-reader version 2.14.0 in Java... - rcode-reader version 2.14.0 java library in your project. ADS_TO_REPLACE_2 Now
Maven dependency for eu.rssw.openedge.rcode - rcode-reader version 2.13.1 is released. Learn to use rcode-reader version 2.13.1 in Maven based Java projects
-reader version 2.13.1 ) in their Java project if it is based on Maven and Gradle...? Steps to use  eu.rssw.openedge.rcode - rcode-reader version 2.13.1 in Java... - rcode-reader version 2.13.1 java library in your project. ADS_TO_REPLACE_2 Now
Maven dependency for eu.rssw.openedge.rcode - rcode-reader version 2.12.1 is released. Learn to use rcode-reader version 2.12.1 in Maven based Java projects
-reader version 2.12.1 ) in their Java project if it is based on Maven and Gradle...? Steps to use  eu.rssw.openedge.rcode - rcode-reader version 2.12.1 in Java... - rcode-reader version 2.12.1 java library in your project. ADS_TO_REPLACE_2 Now

Ads