开发者

Unzipping a file

开发者 https://www.devze.com 2022-12-22 08:54 出处:网络
How to unzip a file from a folder, and then convert the XM开发者_高级运维L document contained in this file, to a CSV format?You can simply use the java.util.zip.* classes to unzip the content of a ZIP

How to unzip a file from a folder, and then convert the XM开发者_高级运维L document contained in this file, to a CSV format?


You can simply use the java.util.zip.* classes to unzip the content of a ZIPped file.

Concerning your conversion from XML to CSV, it is difficult to tell you how you can achieve that without knowing the format of your XML data. However, the simplest thing is to parse the XML, then writing in parallel the content of your CSV file. The CSV format is really simple as it is only values separated by a specific character (generally a , ; or a tabulation).


To unzip file use: java.util.zip.ZipFile

Converting .xml to .csv is less obvious. One of most popular XML parser is Xerces. Of course you can use XSLT to transform your file.

0

精彩评论

暂无评论...
验证码 换一张
取 消