├── .build ├── Manifest.xml ├── default.Manifest.xml ├── default.init.aardio └── default.main.aardio ├── Publish └── xlsSplit.exe ├── README.md ├── default.aproj ├── layout ├── frmRound.html ├── info.html ├── progress.gif ├── styles │ ├── images │ │ └── caption-buttons.png │ ├── main.css │ └── windowBorder.css └── windowBorder.html ├── lib └── config.aardio └── main.aau /.build/Manifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 10 | xlsSplit 11 | 12 | 13 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /.build/default.Manifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 10 | xlsSplit 11 | 12 | 13 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 52 | 53 | 54 | 55 | 56 | 57 | True/PM 58 | 59 | 60 | -------------------------------------------------------------------------------- /.build/default.init.aardio: -------------------------------------------------------------------------------- 1 | //发布前触发 2 | import ide; -------------------------------------------------------------------------------- /.build/default.main.aardio: -------------------------------------------------------------------------------- 1 | //此触发器在生成EXE以后执行 2 | import ide; 3 | import fsys; 4 | 5 | //获取生成的EXE文件路径 6 | var publishFile = ide.getPublishPath(); -------------------------------------------------------------------------------- /Publish/xlsSplit.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuzhanjiang/xlsSplit/13c49a051dff735097747d45ae77c4ee50f6466c/Publish/xlsSplit.exe -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # xlsSplit 2 | 3 | excel文件分割工具,使用aardio开发 4 | 5 | 6 | # 使用方法 7 | 8 | 1. 选择待分割excel文件,工具假设待分割文件第一行为标题行 9 | 2. 输入分割后每个文件的行数,不包括标题行,分割后的文件都有标题行 10 | 3. 这里可以选择一个模板文件,模板第一行为标题行,比如.xlsx文件如果分割后要存为.xls文件,就可以建立一个.xls的模板文件。 11 | 4. 选择分割后文件存储路径,文件名为原文件名加序号 12 | -------------------------------------------------------------------------------- /default.aproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /layout/frmRound.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 |

分割文件

11 |

指定行数

12 |

文件模版

13 |

存放路径

14 |
15 | 16 | </plaintext> 17 | 18 | </div> 19 | </body> 20 | </html> -------------------------------------------------------------------------------- /layout/info.html: -------------------------------------------------------------------------------- 1 | <html> 2 | <head> 3 | <link rel="stylesheet" href="styles/windowBorder.css" /> 4 | <link rel="stylesheet" href="styles/main.css" /> 5 | </head> 6 | <body> 7 | <!--标题栏按钮--> 8 | <div command="window-caption" >xlsSplit_info</div> 9 | <!--标题栏按钮--> 10 | 11 | <!--用于拖动改变窗口大小的边框--> 12 | <div style="behavior:windowSizer" border="4px" corner="8px" > 13 | <div sizer="left_top"></div> 14 | <div sizer="left"></div> 15 | <div sizer="left_bottom"></div> 16 | <div sizer="top"></div> 17 | <div sizer="bottom"></div> 18 | <div sizer="right_top"></div> 19 | <div sizer="right"></div> 20 | <div sizer="right_bottom"></div> 21 | </div> 22 | 23 | <div #main> 24 | <img id="progress" src="progress.gif" style= "visibility = 'hidden'"> 25 | <plaintext id="plaintext" ></plaintext> 26 | <button id="submit" style= "visibility = 'hidden'">确定</button> 27 | </div> 28 | </body> 29 | </html> -------------------------------------------------------------------------------- /layout/progress.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuzhanjiang/xlsSplit/13c49a051dff735097747d45ae77c4ee50f6466c/layout/progress.gif -------------------------------------------------------------------------------- /layout/styles/images/caption-buttons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuzhanjiang/xlsSplit/13c49a051dff735097747d45ae77c4ee50f6466c/layout/styles/images/caption-buttons.png -------------------------------------------------------------------------------- /layout/styles/main.css: -------------------------------------------------------------------------------- 1 | #main{ 2 | height:*; 3 | padding:20px; 4 | } 5 | 6 | #author{ 7 | flow:vertical; 8 | height:*; 9 | } 10 | #author-text{ 11 | position:relative; 12 | height:*; 13 | padding:10px; 14 | vertical-align:bottom; 15 | } -------------------------------------------------------------------------------- /layout/styles/windowBorder.css: -------------------------------------------------------------------------------- 1 | @const BORDER_COLOR: #245E82; 2 | @const CLIENT_COLOR: #EFF7FC; 3 | 4 | body { 5 | margin: 0; 6 | border: 1px solid @BORDER_COLOR; 7 | border-radius: 4px; 8 | background: @CLIENT_COLOR; 9 | } 10 | 11 | div[command=window-caption] { 12 | behavior:windowCommand; 13 | width: 100%%; 14 | border-radius: 4px 4px 0 0; /*圆角*/ 15 | height:21px; 16 | vertical-align: middle; 17 | background: rgba(0, 128, 200, .9) transparent rgba(0, 128, 200, .2) rgba(0, 128, 200, .9) ; 18 | } 19 | 20 | #window-caption-buttons{ 21 | behavior:windowCommand; 22 | position: absolute; 23 | right: 1px; 24 | top: 1; 25 | height: 19px; 26 | } 27 | 28 | #window-caption-buttons [command] { 29 | float: left; 30 | height: 19px; 31 | foreground-image:url( images/caption-buttons.png); 32 | foreground-repeat:no-repeat; 33 | transition: blend; 34 | } 35 | 36 | #window-caption-buttons [command]:hover { 37 | background: rgba(0, 128, 255, .5) rgba(0, 128, 255, .5) transparent transparent; 38 | } 39 | 40 | #window-caption-buttons [command]:active { 41 | background: rgba(0, 128, 255, .9) rgba(0, 128, 255, .9) transparent transparent; 42 | } 43 | 44 | [command=window-min] { 45 | width: 24x; 46 | foreground-position: 0 0; 47 | } 48 | 49 | [command=window-max] { 50 | width: 24px; 51 | foreground-position: -24px 0; 52 | } 53 | 54 | [command=window-restore] { 55 | width: 24px; 56 | foreground-position: -72px 0; 57 | } 58 | 59 | [command=window-close] { 60 | width: 24px; 61 | foreground-position: -48px 0; 62 | } -------------------------------------------------------------------------------- /layout/windowBorder.html: -------------------------------------------------------------------------------- 1 |  <!--标题栏按钮--> 2 | <div command="window-caption" >xlsSplit</div> 3 | <!--标题栏按钮--> 4 | <div #window-caption-buttons> 5 | <a command="window-min" ></a> 6 | <a command="window-max" ></a> 7 | <a command="window-close" ></a> 8 | </div> 9 | 10 | <!--用于拖动改变窗口大小的边框--> 11 | <div style="behavior:windowSizer" border="4px" corner="8px" > 12 | <div sizer="left_top"></div> 13 | <div sizer="left"></div> 14 | <div sizer="left_bottom"></div> 15 | <div sizer="top"></div> 16 | <div sizer="bottom"></div> 17 | <div sizer="right_top"></div> 18 | <div sizer="right"></div> 19 | <div sizer="right_bottom"></div> 20 | </div> 21 | -------------------------------------------------------------------------------- /lib/config.aardio: -------------------------------------------------------------------------------- 1 | //config 配置文件 2 | 3 | import fsys.config; 4 | config = ..fsys.config("/config/"); 5 | 6 | /**intellisense(config) 7 | default.load() = 从配置文件(文件名"default")载入\n加载成功返回对象,加载失败返回null空值\n!fsys_table. 8 | default.save() = 存储到配置文件(文件名"default") 9 | default.mixin = @.mixin(\n 键名 = 值__;\n 键名 = 值;\n);//该数会自动调用save函数保存配置到文件 10 | default.属性名 = 自配置文件(文件名"default")读写属性\n属性值可以是支持序列化的普通变量,支持table对象.\n配置文件在首次使用时自动加载,退出程序时自动保存. 11 | saveAll() = 写入所有配置到文件 12 | end intellisense**/ 13 | -------------------------------------------------------------------------------- /main.aau: -------------------------------------------------------------------------------- 1 | import win.ui; 2 | import console 3 | /*DSG{{*/ 4 | var winform = win.form(text="aardio form";right=431;bottom=422;border="none";mode="popup";parent=...) 5 | winform.add() 6 | /*}}*/ 7 | 8 | import web.layout; 9 | import web.layout.behavior.windowSizer;//支持拖动边框 10 | import web.layout.behavior.windowCommand;//支持标题栏按钮 11 | winform.text="xlsSplit" 12 | wbLayout = web.layout( winform ) 13 | wbLayout.go("/layout/frmRound.html") 14 | 15 | //圆角窗口 16 | import win.util.round; 17 | win.util.round(winform) 18 | 19 | 20 | 21 | 22 | splitxls=function(sourcefile,template,savepath,maxnum){ 23 | var procinfo=wbLayout.getEle("procinfo") 24 | procinfo.value=tostring(time())++" 开始分割" 25 | win.delay(1) 26 | import com.excel 27 | var xls=com.excel( true ) 28 | var wb1=xls.WorkBooks.Open(sourcefile) 29 | var sh1=wb1.Sheets(1) 30 | var rownum=2 31 | var pastebegin=2 32 | var fileno=1 33 | var rows=sh1.UsedRange.Rows.Count+1 34 | while(rownum<rows){ 35 | procinfo.value=tostring(time())++" 第"++fileno++"个文件"+'\n'+procinfo.value 36 | win.delay(1) 37 | 38 | var wb2,sh2 39 | if(#template){ 40 | wb2=xls.WorkBooks.open(template) 41 | sh2=wb2.Sheets(1) 42 | pastebegin=sh2.UsedRange.Rows.Count+1 43 | 44 | } 45 | else { 46 | wb2=xls.WorkBooks.Add() 47 | sh2=wb2.Sheets(1) 48 | sh1.rows(1).Copy() 49 | sh2.Range("A1").PasteSpecial(xlPasteValues,xlNone,False,False) 50 | 51 | } 52 | sh1.rows(rownum++":"++(rownum+maxnum-1)).Copy() 53 | sh2.Range("A"++pastebegin).PasteSpecial(xlPasteValues,xlNone,False,False) 54 | if(#template){ 55 | wb2.SaveAs(savepath++fileno) 56 | } 57 | else{ 58 | wb2.SaveAs( savepath++fileno,51) 59 | } 60 | 61 | wb2.close() 62 | fileno+=1 63 | rownum+=maxnum 64 | 65 | } 66 | 67 | wb1.close() 68 | xls.Quit() 69 | procinfo.value=tostring(time())++" 分割完毕!"+'\n'+procinfo.value 70 | collectgarbage("collect") 71 | } 72 | 73 | dir = wbLayout.getEle("dir") 74 | dir.onButtonStateChanged = function (ltTarget,ltEle,reason,behaviorParams) 75 | { 76 | wbLayout.getEle("filepath").innerText=dir.value 77 | 78 | } 79 | dir.attachEventHandler() 80 | 81 | submit=wbLayout.getEle("submit") 82 | 83 | submit.onButtonClick = function (ltTarget,ltEle,reason,behaviorParams) { 84 | 85 | var sourcefile=wbLayout.getEle("sourcefile").value 86 | var maxnum=wbLayout.getEle("maxnum").value 87 | var template=wbLayout.getEle("template").value 88 | var dir=wbLayout.getEle("dir").value 89 | 90 | import fsys 91 | if (template != "") && (fsys.getFileName(sourcefile)==fsys.getFileName(template)){ 92 | win.msgbox("待分割文件不能与模版文件同名!") 93 | return ; 94 | } 95 | ltEle.state.disabled=true 96 | dir=dir+"\"+string.trimright(fsys.getFileName(sourcefile),"."++fsys.getExtensionName(sourcefile)) 97 | splitxls(sourcefile,template,dir,maxnum) 98 | ltEle.state.disabled=false 99 | } 100 | submit.attachEventHandler() 101 | winform.show() 102 | win.loopMessage(); 103 | return winform; 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | --------------------------------------------------------------------------------