import java.io.*;
import org.apache.poi.hwpf.HWPFDocument;
import org.apache.poi.hwpf.extractor.WordExtractor;
public class LireDoc
{
public static void main(String[] args)
{
try
{
File file = new File("nouveaudoc.doc");
FileInputStream fis = new FileInputStream(file.getAbsolutePath());
HWPFDocument document = new HWPFDocument(fis);
WordExtractor抽出器= new WordExtractor(document);
文字列[] text = extractor.getParagraphText();
for (int i = 0; i < texte.length; i++)
{
if (texte[i] != null)
System.out.println(texte[i]);
}
}
catch (例外 e)
{
e.printStackTrace();
}
}
}
import java.io.*;
import org.apache.poi.xwpf.extractor.XWPFWordExtractor;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
public class ReadDocx
{
public static void main(String[] args)
{
try
{
File file = new File("nouveaudoc.docx");
FileInputStream fis = new FileInputStream(file.getAbsolutePath());
XWPFDocument document = new XWPFDocument(fis);
XWPFWordExtractorエクストラクタ= new XWPFWordExtractor(ドキュメント);
文字列 text = extractor.getText();
System.out.println(テキスト);
}
catch (例外 e)
{
e.printStackTrace();
}
}
}
Please disable your ad blocker and refresh the window to use this website.