`

Java_常见格式的文件Java读写插件

    博客分类:
  • Java
 
阅读更多

How do I access the XYZ file format in java ?

Specifications for many file formats can be found at Wotsit. A large database of file extensions be found at www.file-extensions.org and dotwhat.net

And if you don't know what type a given file is, they there are various way to determine it programmatically: http://www.rgagnon.com/javadetails/java-0487.html

An interesting article about Microsoft's binary file formats, especially DOC and XLS, is Why are the Microsoft Office file formats so complicated? (And some workarounds) It also mentions some alternatives to dealing with those formats directly.

Access

  • JDBC/ODBC bridge - JDBC driver for ODBC databases, comes as part of the JDK; on Linux, you'll have to get ODBC up and running first:http://www.unixodbc.org/
  • Jackcess - library to read and write MDB files
  • HXTT Access - commercial pure Java JDBC driver for MS Access

CGM

  • cgmva - an applet to display CGM files; comes with source code

CHM

  • JChm - library to read CHM files

Excel

  • Apache Commons CSVOstermiller UtilsCSVObjectsCSVBeansopencsvJava CSVSuper CSV - libraries to read and write CSV files. CSV is not as easy to read and write as it first looks - once all the special cases are considered, one might as well use a library.
  • POI - library to read and write XLS and XLSX files
  • JExcelAPI - library to read and write XLS (but not XLSX) files
  • jXLS - library for writing XLS files based on templates
  • Java2Excel - library for creating Excel files based on Collections
  • It is possible to use JDBC to read Excel files
  • Obba works with Excel spreadsheets on Windows
  • OpenXLS - "OpenXLS is the open source version of ExtenXLS - a Java spreadsheet SDK that allows you to read, modify and create Java Excel spreadsheets from your Java applications."

Gedcom

HDF (Hierarchical Data Format)

Image and movie files

  • ImageJ - Java image processing application and library that has plugins for lots of image file formats
  • JIMI - library to read and write BMP, CUR, GIF, ICO, JPEG, PICT, PNG, PSD, Sun Raster, TGA, TIFF, XBM and XPM. There's a plugin for using JIMI with ImageJ, which also includes a couple of JIMI patches.
  • GIF write, TIFF, RAW, PNM and JPEG2000 read/write support for ImageIO: JAI Image I/O Tools
  • Reading QuickTime files in Java. Apple's QT4J library is unfortunately no longer supported.
  • MP4 parser

INI

  • ini4j "is a simple Java API for handling configuration files in Windows .ini format."

Matlab

OpenDocument (ODF)

  • basic Java code for reading ODF files is here
  • ODFDOM is a Java library for accessing ODF files.
  • jDocument.org has an open-source library for accessing all Open Document file types.
  • Obba works with OpenOffice? spreadsheets
  • Office2FO converts ODF documents to XSL-FO documents, making possible further transformations (like conversion to PDF using FOP)

Office Open XML

  • These are the new XML-based Microsoft Office formats.
  • OpenXML4J
  • docx4j - create and edit docx documents using a JAXB content model matching the WordML schema
  • Apache POI implements these formats.

OpenOffice Java API

  • OpenOffice can read a number of file formats, and makes them accessible through its API. A starting point might be this articlethis article and of course theOO developer site
  • Some introductory information about the OO file format can be found here and here
  • oooview is an OO Viewer written in Java.
  • JODConverter is a Java library that uses the OO Java API to perform document conversions between any formats supported by OO

Outlook

  • The Apache POI project developed some code that can read the texual contents of Outlook's MSG files. This page talks about that.
  • Xena can convert multiple file formats -including MSG- to XML. Either the result of that conversion, or Xena's source code, may be helpful.
  • JPST can read and extract PST files.

PDF

  • PDF is a hard to read format. The best one can do is try to extract the text contained in a PDF file.
  • iText - library to create PDFs; see ItextExample for a code example. The older version iText 2 (which uses a more permissive license) is also available: jar filejavadocs
  • FOP - libray to create PDFs (and other formats) from XML by using XSL-FO transformations
  • FlyingSaucer - library to convert CSS-styled XHTML to PDF
  • PDFBox - library that can merge, split and print PDFs, extract text, create images from PDFs, encrypt/decrypt PDFs, fill in PDF forms and more
  • PDF Clown - general-purpose library to read/create/modify PDF files. It features a rich multi-layered object model that allows access even to each single content stream instruction.
  • JPedal - library for viewing and printing PDFs, can also extract text (how to print PDFs); commercial (the LGPL version provides PDF viewing only)
  • PDFTextStream - commercial library to extract text from PDFs
  • PDF Renderer is a more up-to-date PDF viewer that renders using Java2D. DownloadExamplesPrinting PDFs
  • ICEPdf is another library that can render PDFs.
  • Qoppa offers numerous libraries for PDF-related tasks
  • Aspose.Pdf for Java is a commercial library for reading and writing PDFs
  • jPod is a rich PDF manipulation and rendering framework

PowerPoint

  • The Apache POI project developed some code that can open and (to a limited extent) edit PPT files. This page talks about it.

Project

  • The MPXJ library can work with several Project file formats.

PST

  • LibPST is a C library that could be used through JNI.
  • Xena can convert multiple file formats -including PST- to XML. Either the result of that conversion, or Xena's source code, may be helpful.
  • java-libpst is a pure Java library that can access 64bit PST files.

QIF (used by Microsoft Money and Quicken)

  • Buddi and Eurobudget are Java applications that can import and export QIF files (and thus contain code you may be able to use in your application). Both are licensed under the GPL.

RTF

  • jRTF can create RTFs
  • iText 2 can create RTFs: jar filejavadocs
  • JavaCC - is a lexer/parser for which an RTF grammar is available. From that an RTF reader can be constructed.

Visio

  • The Apache POI project developed some code that can read Visio files. This page talks about that.

Word

  • POI - library to read and write DOC and DOCX files. It can also be used for extracting the text of a document.
  • WordApi.exe is native Windows component with a Java interface, which lets you create Word documents, and alter word templates. Some impressions about it can be found here.
  • Java2Word - library to create Word documents, especially reports, on the fly.

Something else?

If you encounter an obscure format for which no library is available, it may be feasible to create a reader for it if you have a file format description (which may be available on Wotsit, see link above). Several libraries, so-called lexers and parsers, are available that help in creating a reader, especially if the file format is ASCII, and not binary. You will need knowledge of regular expressions, though. Some file formats that have been tackled using this approach include RTF, CSV, HPGL and PBM/PGM/PPM. Lexers are easier to start with, but parsers can do more of the work for you. All these have ready-to-use examples on their web sites.

分享到:
评论

相关推荐

    java插件,组件 读写Excel文件

    java插件,组件 读写Excel文件java插件,组件 读写Excel文件

    JAVA_API1.6文档(中文)

    java.util.jar 提供读写 JAR (Java ARchive) 文件格式的类,该格式基于具有可选清单文件的标准 ZIP 文件格式。 java.util.logging 提供 JavaTM 2 平台核心日志工具的类和接口。 java.util.prefs 此包允许应用程序...

    基于java的开发源码-FAT文件系统读写类库 fat32-lib.zip

    基于java的开发源码-FAT文件系统读写类库 fat32-lib.zip 基于java的开发源码-FAT文件系统读写类库 fat32-lib.zip 基于java的开发源码-FAT文件系统读写类库 fat32-lib.zip 基于java的开发源码-FAT文件系统读写类库 ...

    JAVA上百实例源码以及开源项目

    Java读写文本文件的示例代码 1个目标文件。 java俄罗斯方块 一个目标文件。 Java非对称加密源码实例 1个目标文件 摘要:Java源码,算法相关,非对称加密  Java非对称加密源程序代码实例,本例中使用RSA加密技术,...

    基于Java的源码-FAT文件系统读写类库 fat32-lib.zip

    基于Java的源码-FAT文件系统读写类库 fat32-lib.zip

    java源码包---java 源码 大量 实例

    Java读写文本文件的示例代码 1个目标文件。 java俄罗斯方块 一个目标文件。 Java非对称加密源码实例 1个目标文件 摘要:Java源码,算法相关,非对称加密  Java非对称加密源程序代码实例,本例中使用RSA加密技术,...

    JAVA文件读写操作教程与示例代码.docx

    在Java编程中,文件读写操作是非常常见和重要的一部分。通过文件读取,我们可以从文件中获取数据;通过文件写入,我们可以将数据存储到文件中。本文将详细介绍Java中的文件读写操作,并提供多个实例代码来帮助您理解...

    基于java的开发源码-读写文本文件的示例代码.zip

    基于java的开发源码-读写文本文件的示例代码.zip 基于java的开发源码-读写文本文件的示例代码.zip 基于java的开发源码-读写文本文件的示例代码.zip 基于java的开发源码-读写文本文件的示例代码.zip 基于java的开发...

    Java+flex使用dom4j读写xml

    这个小例子是使用Java作为服务端、Flex做前台,对一个xml文件的读取和写入。 环境:MyEclipse6.0.1+Flex3插件版,jdk1.6,tomcat6.0,dom4j1.6.1,lcds.war, 使用技术:1.Java+flex,及其对象的转换。 2.Java方面...

    JAVA上百实例源码以及开源项目源代码

    Java读写文本文件的示例代码 1个目标文件。 java俄罗斯方块 一个目标文件。 Java非对称加密源码实例 1个目标文件 摘要:Java源码,算法相关,非对称加密  Java非对称加密源程序代码实例,本例中使用RSA加密技术,...

    Java 1.6 API 中文 New

    java.util.jar 提供读写 JAR (Java ARchive) 文件格式的类,该格式基于具有可选清单文件的标准 ZIP 文件格式。 java.util.logging 提供 JavaTM 2 平台核心日志工具的类和接口。 java.util.prefs 此包允许应用程序...

    网上订餐系统的设计与实现_java_springboot_ssm_网上订餐系统_MYSQL_

    本系统采用的技术栈有:springboot、spring、springmvc、mybatis、shiro...本系统中的购物车功能设计、io读写图片存放本地、订单导出、echarts插件实现订单信息统计、后台批量操作、pagehelper实现分页等细节值得学习。

    java源码包4

    Java读写文本文件的示例代码 1个目标文件。 java俄罗斯方块 一个目标文件。 Java非对称加密源码实例 1个目标文件 摘要:Java源码,算法相关,非对称加密  Java非对称加密源程序代码实例,本例中使用RSA加密技术...

    java源码包3

    Java读写文本文件的示例代码 1个目标文件。 java俄罗斯方块 一个目标文件。 Java非对称加密源码实例 1个目标文件 摘要:Java源码,算法相关,非对称加密  Java非对称加密源程序代码实例,本例中使用RSA加密技术...

    java源码包2

    Java读写文本文件的示例代码 1个目标文件。 java俄罗斯方块 一个目标文件。 Java非对称加密源码实例 1个目标文件 摘要:Java源码,算法相关,非对称加密  Java非对称加密源程序代码实例,本例中使用RSA加密技术...

    java开源包4

    Blister是一个用于操作苹果二进制PList文件格式的Java开源类库(可用于发送数据给iOS应用程序)。 重复文件检查工具 FindDup.tar FindDup 是一个简单易用的工具,用来检查计算机上重复的文件。 OpenID的Java客户端...

    java开源包101

    Blister是一个用于操作苹果二进制PList文件格式的Java开源类库(可用于发送数据给iOS应用程序)。 重复文件检查工具 FindDup.tar FindDup 是一个简单易用的工具,用来检查计算机上重复的文件。 OpenID的Java客户端...

Global site tag (gtag.js) - Google Analytics