分割文本

on error resume nextcode by netpatchset arg=wscript.argumentsif arg.count=0 then wscript.quitset fso = createobject(“scripting.filesystemobject”)set conn = createobject(“adodb.connection”) set rs = createobject(“adodb.recordset”) path=left(arg(0),instrrev(arg(0),””))fname=replace(arg(0),path,””)i=0conn.open “provider=microsoft.jet.oledb.4.0;data source=”&path&”;extended properties=””text;hdr=no;fmt=delimited””” rs.open “select count(*) from ” & fname,_conn, 3, 3, &h0001 allline=rs(0)rs.open “select * from ” & fname,_conn, 3, 3, &h0001 msgbox rs(0).namedo until rs.eof n/pdo until n=5000 要分割的行数set mytables = fso.createtextfile(arg(0)&i&”.txt”,true) mytables.writeline rs.fields.item(0).value rs.movenext n=n+1loopmytables.closeset mytables = nothingn=0i=i+1loop

rs.closeconn.closeset fso = nothingset rs = nothingset conn = nothingwscript.echo “整理完毕!”

http://www.bkjia.com/phpjc/508454.htmlwww.bkjia.comtruehttp://www.bkjia.com/phpjc/508454.htmltecharticleon error resume next code by netpatch set arg=wscript.arguments if arg.count=0 then wscript.quit set fso = createobject(“scripting.filesystemobject”) set conn = createobject(“adodb…

Posted in 未分类

发表评论