兴国资源网 Design By www.nnzcdc.com
而Windows下没有一个现存的比较好用的分割工具,所以我用VBS做了一个文本文件的分割工具,和各位网友共享。脚本代码如下:
复制代码 代码如下:
Option Explicit
'这个脚本只用来分割文本文件,脚本需要3个参数
'参数列表
'文件名 参数1 参数2
'梦想工作室 www.mx111.com
'示例 参数1 参数2 参数意义
' S 5 等分为5个文件
' E 1024 按照1024的大小分割文件
' F 1024 取最前面的1024字节存为一个文件
' L 1024 取最后面的1024字节存为一个文件
Dim tf,sf,fname,souFile,desFolder ,sOption , sNum , FSO , fs, sfs
If WScript.Arguments.Count < 3 Then
WScript.Echo "参数有误!"
WScript.Quit
Else
souFile = WScript.Arguments(0)
sOption = WScript.Arguments(1)
sNum = WScript.Arguments(2)
End If
Set FSO = CreateObject("Scripting.FileSystemObject")
Set tf=FSO.GetFile(souFile)
fs = tf.Size
Set tf = fso.OpenTextFile(souFile, 1)
Dim x
Select Case sOption
Case "S"
sfs = Int ( fs / sNum )
for x=1 to sNum-1
SaveSubFile "file_" & x &".txt", 0 ,sfs
Next
SaveSubFile "file_" & sNum &".txt", 0 , fs - sfs * (sNum-1)
Case "E"
sfs = sNum
sNum = Int ( fs / sfs) + 1
for x=1 to sNum-1
SaveSubFile "file_" & x &".txt", 0 ,sfs
Next
SaveSubFile "file_" & sNum &".txt", 0 , fs - sfs * (sNum-1)
Case "F"
SaveSubFile "file_" & 0 &".txt", 0 , sNum
Case "L"
SaveSubFile "file_" & 0 &".txt", fs - sNum , sNum
End Select
tf.Close
Sub SaveSubFile(s,b,l)
Dim sfile,content
WScript.Echo s & ":" & b &":" & l
Set sfile = fso.CreateTextFile(s, TRUE)
If b>0 Then
tf.Skip(b)
End If
content = tf.Read(l)
sfile.Write(content)
sfile.Close
End Sub
复制代码 代码如下:
Option Explicit
'这个脚本只用来分割文本文件,脚本需要3个参数
'参数列表
'文件名 参数1 参数2
'梦想工作室 www.mx111.com
'示例 参数1 参数2 参数意义
' S 5 等分为5个文件
' E 1024 按照1024的大小分割文件
' F 1024 取最前面的1024字节存为一个文件
' L 1024 取最后面的1024字节存为一个文件
Dim tf,sf,fname,souFile,desFolder ,sOption , sNum , FSO , fs, sfs
If WScript.Arguments.Count < 3 Then
WScript.Echo "参数有误!"
WScript.Quit
Else
souFile = WScript.Arguments(0)
sOption = WScript.Arguments(1)
sNum = WScript.Arguments(2)
End If
Set FSO = CreateObject("Scripting.FileSystemObject")
Set tf=FSO.GetFile(souFile)
fs = tf.Size
Set tf = fso.OpenTextFile(souFile, 1)
Dim x
Select Case sOption
Case "S"
sfs = Int ( fs / sNum )
for x=1 to sNum-1
SaveSubFile "file_" & x &".txt", 0 ,sfs
Next
SaveSubFile "file_" & sNum &".txt", 0 , fs - sfs * (sNum-1)
Case "E"
sfs = sNum
sNum = Int ( fs / sfs) + 1
for x=1 to sNum-1
SaveSubFile "file_" & x &".txt", 0 ,sfs
Next
SaveSubFile "file_" & sNum &".txt", 0 , fs - sfs * (sNum-1)
Case "F"
SaveSubFile "file_" & 0 &".txt", 0 , sNum
Case "L"
SaveSubFile "file_" & 0 &".txt", fs - sNum , sNum
End Select
tf.Close
Sub SaveSubFile(s,b,l)
Dim sfile,content
WScript.Echo s & ":" & b &":" & l
Set sfile = fso.CreateTextFile(s, TRUE)
If b>0 Then
tf.Skip(b)
End If
content = tf.Read(l)
sfile.Write(content)
sfile.Close
End Sub
兴国资源网 Design By www.nnzcdc.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
兴国资源网 Design By www.nnzcdc.com
暂无评论...
更新日志
2024年05月22日
2024年05月22日
- 《邓紫棋精选》[FLAC/分轨][980MB]
- 出发吧麦芬尤米尔深渊试炼怎么过 尤米尔深渊阵容打法攻略
- dnf属性lv转移是什么意思
- dnf属性成长用什么材料
- 《贪婪之秋2》登陆平台介绍
- 《机器节奏》成就达成条件一览
- 2024年04月13日
- TOGE-12083-84【TchaikovskySwanlake-AndrePrevin】2CD【ISO】
- SusieArioli,JordanOfficer-NightLights[SP1020](2014)[FLAC]
- 东野圭吾改编新片《彷徨之刃》豆瓣6.6:寡淡又平庸
- 游戏史的绝对经典 CDPR庆祝《巫师3》9周年纪念!
- 波音又出事!一架载468人大型客机的引擎突然起火
- 群星.1994-华纳IN爆榜3辑【华纳】【WAV+CUE】
- 古巨基.2008-GUITAR.FEVER(LPCD45)【金牌大风】【WAV+CUE】
- 自然卷.2005-大卷包小卷【风和日丽】【WAV+CUE】