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



Home Answers Viewqa Java-Beginners How to read a line from a doc file

Have Programming Question? Ask it here!
 
 
 


Nitin Sapra
How to read a line from a doc file
2 Answer(s)      3 years and 9 months ago
Posted in : Java Beginners


How to read a line from a doc file


Advertisement
View Answers

October 21, 2010 at 5:51 PM


Hi Friend,

To run the following code, you need to download POI library.

import java.io.*;
import org.apache.poi.hwpf.HWPFDocument;
import org.apache.poi.hwpf.extractor.WordExtractor;

public class ReadDocFile {
public static void main(String[] args) {
File file = null;
WordExtractor extractor = null ;
try {

file = new File("c:\\Hello.doc");
FileInputStream fis=new FileInputStream(file.getAbsolutePath());
HWPFDocument document=new HWPFDocument(fis);
extractor = new WordExtractor(document);
String [] fileData = extractor.getParagraphText();
for(int i=0;i<fileData.length;i++){
if(fileData[i] != null)
System.out.println(fileData[i]);
}
}
catch(Exception exep){}
}
}

Thanks



May 7, 2011 at 11:47 AM


Hey Man.It working fine but this is reading without formats i mean simple formats no info about the font size and font type.



Related Tutorials/Questions & Answers:
How to read a line from a doc file
How to read a line from a doc file  How to read a line from a doc file   Hi Friend, To run the following code, you need to download POI... void main(String[] args) { File file = null; WordExtractor extractor = null
how read data from doc file in same formate in jsp
how read data from doc file in same formate in jsp  how we can read and display data on jsp page, from doc file with the same formatting
Advertisements
How to read the .doc/ .docx file in Java Program
How to read the .doc/ .docx file in Java Program  Hi, I am beginner in Java programming language. Can anybody explain How to read .doc file in Java.... This way you can read the .doc or .docx file in Java programming language. Thanks
How can i read a file from nth line onwards in java
How can i read a file from nth line onwards in java  Hi, I need to read a file content from its nth line onwards till end. How can i implement it in java. Regards, Chinnu
How to Read a file line by line using BufferedReader?
How to Read a file line by line using BufferedReader?  Hello Java... to Read a file line by line using BufferedReader, efficiently and using less memory... at a time very efficiently. View the detailed example and code at Java Read File Line
read doc and docx file in javascript
read doc and docx file in javascript  How i read doc and docx file in javascript
Read Specific Line from file Using Java
Read Specific Line from file Using Java Here we are going to read a specific line from the text file. For this we have created a for loop to read lines 1 to 10 from the text file. If the loop reached fifth line, the br.readLine() method
How to read big file line by line in java?
Learn how to write a program in java for reading big text file line by line In this tutorial I will explain you how you can read big file line by line... BufferedReader(fileReader); String oneLine; //Read file line by line while
Read file from the Nth line
Read file from the Nth line Java provides several classes and methods to manipulate file. A file reading, is a common operation. Usually a file is to be read from top to bottom but here we are going  to read a file content from
How to read a large text file line by line in java?
How to read a large text file line by line in java?  I have been... you kind advice and let's know how to read a large text file line by line in java... memory assigned is also a limit. So, we have decided to read the text file line
Java read file line by line
Java read file line by line In this section, you will learn how to read a file... are going to read a file line by line. For reading text from a file it's better... class is used to read text from a file line by line using it's readLine method
How to Read file line by line in Java program
Programmers have always found it difficult to read a big file (5-10 GB) line by line in Java. But there are various ways that can help read a larger file..., a BufferedReader object is created that reads from the file line by line until
How to read a file line by line?
Using Java Read Specific Line from file Using Java How to read file from Applet... is to be developed. The best solution is to read the file one line a time
objective c read file line by line
objective c read file line by line  Please explain how to read files in Objective C line by line
Java Read File Line by Line - Java Tutorial
Read Specific Line from file Using Java How to read file from Applet BufferedInputStream Example... tutorial that explains you how to read a text file in Java one line at a time
serch document from .doc and .docx file
serch document from .doc and .docx file  how to find particular word from .doc and .docx file and that date insert into a data base
Java Read File Line By Line, Video Tutorial of Java Read File Line By Line
a program in Java programming language to read a text file line by line. The "Java Read File Line by line" is most searched topics by the Java developers... situations where it is required to read the large text file ranging from 1 GB
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... and parse the file path. Through the code, we want to read the line 3 of the file
Java - How to read a string line per line
(System.getProperty("line.separator")); Read more at: Java Read File Line by Line Java Read File Line By Line, Video Tutorial Line by Line reading from...Java - How to read a string line per line  Java - How to read
how to read the .proprties file from struts - Struts
how to read the .proprties file from struts   errpr is :file not found exception:applicationresource.proprties file {system canot find file path"; How to set the file path.  Hi Friend, It seems that you haven't
Java read file line by line - Java Tutorial
ReadFile This is a text file? C:\nisha> This program reads the bytes from file and display it to the user. Download... input line by line with an appropriate BufferedReader
Read from file java
Read from file java  How to Read from file java? What is the best method for a text file having a size of 10GB. Since i have to process the file one line at a time so tell me the very best method. Thank you
How to extract a specific line from a text file? - IoC
How to extract a specific line from a text file?  Hi all, i'm trying to write a code that return a specific line from a text file. so my first simple code here allows me to read the content of my file Text.file
How To Read Integer From Command Line In Java
How To Read Integer From Command Line In Java In this section we will discuss about how an integer can be read through the command line. In Java all... value from the command line. In this example I have created a class named
how to store/retrieve doc file - Java Beginners
how to store/retrieve doc file  i want to wirte a code that stores/ retrieves .doc files to the mysql database using jsp pages... can anyone help me with the code?  Use this stuff inside your jsp page for store file
How to Check Markup in PHP File from Command Line
How to Check Markup in PHP File from Command Line  Check Markup in PHP File from Command Line   PHP has a feature that allowed you to check... try this: http://www.phpzag.com/check-markup-in-php-file-from-command-line
How to read and display data from a .properties file from a jsp page
How to read and display data from a .properties file from a jsp page  I have a .properties file. I have to create a jsp page such that it reads the data from this .properties file and display it in table format. Ex:by using
How to read file in java
-independent way.  BufferedReader-This class read the text from a file line...How to read file in java Java provides IO package to perform reading and writing operations with a file. In this section you will learn how to read a text
How To Read String From Command Line In Java
How To Read String From Command Line In Java In this section we will discuss about how string can be read through the command line. In Java command line... demonstrates that how to take input from command line. Here in this example we
Java read lines from file
Java read lines from file  Any code example related to Java read lines from file? In my project there is requirement of reading the file line by line... to read the whole file in one go. So, in my case reading file line by line is only
how to convert doc file into html using java swing
how to convert doc file into html using java swing  i want to convert doc file into html and display it on jtextarea please help me and give the sample code
doc file - Java Beginners
doc file   i want to read .doc file ?....it is a part of my project plz help. if possible , can anyone give me the code
Java Read .doc file using POI library
Java Read .doc file using POI library In this section, you will learn how to read the word document file using POI library. The class HWPFDocument throw all of the Word file data and the class WordExtractor extract the text from
Convesion of txt file to doc file.??????
Convesion of txt file to doc file.??????  how to convert text file to doc file using java
Read Property file From Jmeter
Read Property file From Jmeter  Hi, I am running web driver script from Jmeter, but while reading property file I am getting "File Not Find Exception". Please tell me how to read ".properties" file from Jmeter
Write data in doc file
Write data in doc file  How to write data or string in word file
How to write file by line in Java
How to write file by line in Java  How to write file by line in Java   Hi, For Write to a file by line using java programming language we... in a new line. How to use Write To File By Line in Java programs
Read Lines from text file
read from the text file and displays the output as desired. Unable to read the rest...Read Lines from text file  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
how to create xml schema from xml doc using java
how to create xml schema from xml doc using java  i want to create xml schema from xml document programatically using java... am using Netbeans IDE 7.0 i hav created the xml document for a table of data from Database... now i
how to write to file at the end of the line
how to write to file at the end of the line using Java program. Plz suggest... will help you for "How to write the file at the end of line using Java language." Please visit this link : how to write to file at the end of the line
How to Read a File in Java
but reading a character line by line from a file. Now we are going to read a file...How to Read a File in Java? In this section we are going to know, How to read... to be read from the file, converted into character, and then returned, which
Reading .doc file using swing
Reading .doc file using swing  Sir, Could U Please Tell me the Way To Read .doc file in java using swing,with code
How to read data from txt file and save to database MySql - Java Beginners
How to read data from txt file and save to database MySql  Please help me again ,my problem right know is how to read data from txt file then data...(in)); String strLine; //Read File Line By Line while ((strLine
how to read from dictionary c
how to read from dictionary c  how to read elements from dictionary in c programming
How to read a log file from server location and send a mail when exception occurs.
How to read a log file from server location and send a mail when exception occurs.  HI, How can i read the 2GB to 4GB log file from server. and i need to send a mail when exception occurs. Thanks Rajeev
writing document (.doc) file from java with format such as font type, font style
writing document (.doc) file from java with format such as font type, font style  Can anyone help me how can i write a java code to write a string... FileInputStream(file)); HWPFDocument doc = new HWPFDocument(fs); Range range
Read Text file from Javascript - JSP-Servlet
Read Text file from Javascript  plz send the code How to Retrieve the data from .txt file thru Javascript? And how to find the perticular words in that file
C file read example
C file read example       This section demonstrates you to read a line from the file. You can see in the given example, we prompt the user to enter the name of the file to read
read excel file from Java - Java Beginners
read excel file from Java  How we read excel file data with the help of java?  Hi friend, For read more information on Java POI visit to : http://www.roseindia.net/java/poi/ Thanks
Java read file
There are many ways to read a file in Java. DataInputStream class is used to read text File line by line. BufferedReader is also used to read a file in Java... line. Example of Java Read File: package FileHandling; import
Advertisements
 

 

 

DMCA.com