GroupDocs.Editor for Java API 是编辑 Microsoft Word、Excel、PowerPoint、Open Office 文档和演示文稿的正确选择。 GroupDocs.Editor 是一个独立的 API,适用于需要高性能的服务器端和后端系统。它不依赖于任何软件,如 Microsoft 或 Open Office。
GroupDocs.Editor for Java 为开发人员提供了一种使用几行代码编辑 CSV 文件的简单直接的方法。
Editor
类的实例并加载 CSV 文件DelimitedTextEditOptions
类实例,并在构造函数中指定强制字符串分隔符Editor.Edit()
方法并获得 HTML 格式的 CSV 文档,该文档可使用任何所见即所得编辑器轻松编辑。Editor.Save()
方法并使用带有所需分隔符的 DelimitedTextSaveOptions
类实例保存编辑的 CSV 文件使用 GroupDocs.Editor for Java API 进行基本文档编辑可以通过几个简单的步骤来完成。所有主要平台和操作系统都支持我们的 API。在执行以下代码之前,请确保您的系统上安装了以下先决条件。
// Load the CSV file into Editor with no extra loading options
Editor editor = new Editor("source.csv");
// Create edit options for delimited text and specify a mandatory separator in the constructor
DelimitedTextEditOptions editOptions = new DelimitedTextEditOptions(",");
// Open input CSV document for edit — obtain an intermediate document, that can be edited
EditableDocument beforeEdit = editor.edit(editOptions);
// Grab CSV document content and associated resources from editable document
string content = beforeEdit.getContent();
// Send the content to WYSIWYG-editor, edit it there, and send edited content back to the server-side
// This step simulates a such operation
string updatedContent = content.replace("Cell Text", "Edited Cell Text");
// Grab edited content and resources from WYSIWYG-editor and create a new EditableDocument instance from it
EditableDocument afterEdit = EditableDocument.fromMarkup(updatedContent, null);
// Create save options for delimited text and specify a mandatory separator in the constructor
DelimitedTextSaveOptions saveOptions = new DelimitedTextSaveOptions(",");
// Save edited CSV document to the file
editor.save(afterEdit, "edited.csv", saveOptions);
立即访问 GroupDocs.Editor 现场演示 网站编辑 CSV。 现场演示有以下好处
无需下载 API
无需编写任何代码
只需上传源文件
获取下载链接以保存文件
您还可以编辑其他文件格式。请参阅下面的完整列表。
(Microsoft Word Binary Format)
(Office 2007+ Word Document)
(Microsoft Word 2007 Marco File)
(Microsoft Word Template File )
(Microsoft Excel Spreadsheet (Legacy))
(Open XML Workbook)
(Macro-enabled Spreadsheet)
(Microsoft PowerPoint 97-2003)
(Open XML presentation Format)
(Macro-enabled Presentation File)
(Open Ebook Format)
(Open eBook File)
(Hyper Text Markup Language)
(Web Page Archive Format)
(Text Document)
(XML File)
(Tab Seperated Values)
(Rich Text Format)
(OpenDocument Text File Format)
(Outlook Message Item File)