mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-02 03:58:07 +08:00
4b8dd7a9ca
* feat: Office viewer 支持 Excel * 修复类型报错 * 修复类型报错
24 lines
459 B
TypeScript
24 lines
459 B
TypeScript
/**
|
|
* 创建个大的csv文件
|
|
*/
|
|
|
|
import process from 'node:process';
|
|
|
|
const columns = 10;
|
|
const rows = 1000000;
|
|
|
|
// 写入 csv header
|
|
const header: string[] = [];
|
|
for (let i = 0; i < columns; i++) {
|
|
header.push(`col${i}`);
|
|
}
|
|
process.stdout.write(header.join(',') + '\n');
|
|
|
|
for (let i = 0; i < rows; i++) {
|
|
const row: string[] = [];
|
|
for (let j = 0; j < columns; j++) {
|
|
row.push(`r${i} c${j}`);
|
|
}
|
|
process.stdout.write(row.join(',') + '\n');
|
|
}
|