Java Buffered Reader

Ads

 
 

Share on Google+Share on Google+

AkshayJeet10
Java Buffered Reader
0 Answer(s)      5 years and 10 months ago
Posted in : Java Beginners

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...

Ads
View Answers
Ads









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... an example from 'JSP Buffered Reader'. To grasp and understand the example we create
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 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 : Video: How to use Buffered Streams in Java? Buffered Byte
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.... This class can not be instantiated directly. Constructor of Reader
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
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
Barcode reader
Barcode reader  hi all, i wont to operation in the out put from Barcode reader. dose java support Barcode reader`s result
Gobits Reader
Gobits Reader       Gobits Reader is a lightweight, web-based news reader on steroids, combined with a powerful blog creator. They are also supplying a built-in webmail that is one
PDF reader in android - JavaMail
PDF reader in android  Hi, iam trying to open and perform basic operations on PDF file in android. But i unable to get it. IS there any possibilities to solve that problem? Waiting for reply
barcode reader using jsp
barcode reader using jsp  HI ALL, I need jsp code for barcode reader.When we scan the barcode image that barcode value will be stored in one textbox automatically. please helpe me. Regards Bhanu
com.pixelmed.dicom.DicomException: No reader for jpeg-lossless available
com.pixelmed.dicom.DicomException: No reader for jpeg-lossless available   com.pixelmed.dicom.DicomException: No reader for jpeg-lossless available
Version of com.graphhopper>graphhopper-reader-gtfs dependency
List of Version of com.graphhopper>graphhopper-reader-gtfs dependency
Version of com.graphhopper>graphhopper-reader-json dependency
List of Version of com.graphhopper>graphhopper-reader-json dependency
Version of com.graphhopper>graphhopper-reader-osm dependency
List of Version of com.graphhopper>graphhopper-reader-osm dependency
Version of com.graphhopper>graphhopper-reader-shp dependency
List of Version of com.graphhopper>graphhopper-reader-shp dependency
Version of com.graphhopper>graphhopper-reader-overlay-data dependency
List of Version of com.graphhopper>graphhopper-reader-overlay-data dependency
Version of com.rgi-corp>graphhopper-reader-json dependency
List of Version of com.rgi-corp>graphhopper-reader-json dependency
Version of com.rgi-corp>graphhopper-reader-osm dependency
List of Version of com.rgi-corp>graphhopper-reader-osm dependency
Version of com.rgi-corp>graphhopper-reader-shp dependency
List of Version of com.rgi-corp>graphhopper-reader-shp dependency
URL Connection Reader
URL Connection Reader       In this section, you will learn about the url connection reader... is  the Output  of above program: C:\rose>java
Java file line reader
Java file line reader In this section, you will learn how to read a particular line from file. Sometimes you want to read a particular line from the file but you have to read the whole file for this process. So in order to remove
Maven Dependency graphhopper-reader-gtfs >> 0.9.0-RC1
You should include the dependency code given in this page to add Maven Dependency of com.graphhopper >> graphhopper-reader-gtfs version0.9.0-RC1 in your project
Maven Dependency graphhopper-reader-osm >> 0.8.2
You should include the dependency code given in this page to add Maven Dependency of com.graphhopper >> graphhopper-reader-osm version0.8.2 in your project
Maven Dependency graphhopper-reader-json >> 0.9.0-RC1
You should include the dependency code given in this page to add Maven Dependency of com.graphhopper >> graphhopper-reader-json version0.9.0-RC1 in your project
Maven Dependency graphhopper-reader-osm >> 0.8.0
You should include the dependency code given in this page to add Maven Dependency of com.graphhopper >> graphhopper-reader-osm version0.8.0 in your project
Maven Dependency graphhopper-reader-osm >> 0.8.0-RC2
You should include the dependency code given in this page to add Maven Dependency of com.graphhopper >> graphhopper-reader-osm version0.8.0-RC2 in your project
Maven Dependency graphhopper-reader-osm >> 0.9.0-RC1
You should include the dependency code given in this page to add Maven Dependency of com.graphhopper >> graphhopper-reader-osm version0.9.0-RC1 in your project
Maven Dependency graphhopper-reader-shp >> 0.9.0-RC1
You should include the dependency code given in this page to add Maven Dependency of com.graphhopper >> graphhopper-reader-shp version0.9.0-RC1 in your project

Ads

 
Advertisement null

Ads