Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners Java Buffered Reader
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


AkshayJeet10
Java Buffered Reader
0 Answer(s)      3 years 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...


Advertisement
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... 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 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
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 then we are trying to interact our Java program to read from or write data
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
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
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
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
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
Show Image Reader and Image Writer by MIME Type
Show Image Reader and Image Writer by MIME Type... the Image Reader and Image Writer by by MIME Type.  To show the image reader and image writer by MIME Type, we have used ImageIO class of the package
Show Image Reader and Image Writer by image format
Show Image Reader and Image Writer by image format... to display the Image Reader and Image Writer by the image format.  To show the image reader and image writer, we have used ImageIO class of the package
Example to show exception handling in java
= new BufferedReader(new FileReader("girish")):-Buffered reader... Example to show exception handling in java   ... that show you the use of exception class in java .Exceptions handling
Java Beans Books
Java Beans Books         Java Beans book review The book opens with a high-level look at component software, introducing the reader
Java programming: generating series
Java programming: generating series  Write a program to accept a string using buffered reader and replace character sequence 'cat' with 'dog'   Here is a java code that accept the string from the user using
java programmming: string manipulation
java programmming: string manipulation  WAP to accept a string from the user, using buffered reader and then find the frequency of character 'e' occurring in it   Here is a java example that reads a string from
Core Java - Java Beginners
Core Java  How can I take input?  hai.... u can take input through command line or by using buffered reader. An wexample for by using... information : http://www.roseindia.net/java/ Thanks
File Handling In Java
File Handling In Java In this section we will discussed about How files can be handled in Java. In this tutorial we will learn the various aspect of file handling in Java. Most of the software's important feature is how to read data
Mobile RMS Reader 0.5.1
Mobile RMS Reader 0.5.1     ...://www.cumminsonline.com.ar/eclipse/mobile-rms-reader/mobileremsreader.zip ...-rms-reader/index.htm        
File Reader example in JRuby
File Reader example in JRuby   ... FileReaderExample.rb require "java" include_class...;java" shows that we are making our JRuby program enable to use java classes. 
Line Number Reader Example
Line Number Reader Example       In this example we are reading  number of lines...:\convert\rajesh\completed>java LineNumberReaderExample Line: 1: import java.io.
programs - Java Beginners
Buffered Reader and Buffered writer . 24. Write a Java program to read and write.... (by using methods of minimum and maximum of numbers) 3. Write a Java program to demonstrate inheritance. 4. Write a Java program to demonstrate dynamic
programs - Java Beginners
Buffered Reader and Buffered writer . 24. Write a Java program to read and write.... (by using methods of minimum and maximum of numbers) 3. Write a Java program to demonstrate inheritance. 4. Write a Java program to demonstrate dynamic
Java binary to decimal
Java binary to decimal       This Tutorial helps you to know the code for Java binary... you in understanding a how to get a 'Java binary to decimal'. For this we have
Java I/O Assistance + Loop
(); writer.close(); //A buffered Reader is used for reading a new file...Java I/O Assistance + Loop  I'm trying to make this program write... to prevent the program from crashing try { //a buffered writer is used
 

 

 

DMCA.com