admin 管理员组

文章数量: 1086019


2024年4月19日发(作者:evaluation的同义词)

import edOutputStream;

import tputStream;

import ;

import tFoundException;

import tputStream;

import ption;

public class javaxml {

/*

* java大数据导出xml或excel

* */

public static void main(String[] args) {

StringBuffer sb = new StringBuffer();

try {

DataOutputStream rafs = new DataOutputStream(

new BufferedOutputStream(new FileOutputStream(new File(

"d://"))));

("");

("n");

("");

("n");

("

xmlns="urn:schemas-microsoft-com:office:spreadsheet"");

("n");

(" xmlns:o="urn:schemas-microsoft-com:office:office"");

("n");

(" xmlns:x="urn:schemas-microsoft-com:office:excel"");

("n");

(" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"");

("n");

(" xmlns:html="/TR/REC-html40">");

("n");

(" n");

(" n");

(" n");

int sheetcount = 0;

int recordcount = 60000;//每个sheet的数据

int currentRecord = 0;

int total = 600000;//总记录

int col = 5;//列数

("");

("n");

("

+ "" ss:ExpandedRowCount="" + total

+ "" x:FullColumns="1" x:FullRows="1">");

("n");

for (int i = 0; i < total; i++) {

if ((currentRecord == recordcount

|| currentRecord > recordcount || currentRecord == 0)

&& i != 0) {// 一个sheet写满

currentRecord = 0;

(ng().getBytes());

gth(0);

("

");

("

xmlns="urn:schemas-microsoft-com:office:excel">");

("n");

("False");

("n");

("False");

("n");

("");

("n");

("");

("");

("n");

("

ss:ExpandedRowCount="" + recordcount

+ "" x:FullColumns="1" x:FullRows="1">");

("n");

}

("");

for (int j = 0; j < col; j++) {

n(i);

sb

.append("

ss:Type="String">"+j+"");

("n");

}

("");

""

if (i % 5000 == 0) {

}

(ng().getBytes());

();

gth(0);

("n");

currentRecord++;

}

(ng().getBytes());

gth(0);

("

");

("

xmlns="urn:schemas-microsoft-com:office:excel">");

("n");

}

}

("False");

("n");

("False");

("n");

("");

("n");

("");

("");

("n");

(ng().getBytes());

();

();

} catch (FileNotFoundException e) {

tackTrace();

} catch (IOException e) {

tackTrace();

}


本文标签: 同义词 数据 作者 导出