and Windows does not have an existing more useful segmentation tool, so I use VBS to do a text file segmentation tool, and you share. The script code is as follows:
Copy Code code as follows:
Option Explicit
' This script is only used to split text files, the script requires 3 parameters
' Argument list
' filename parameter 1 parameter 2
' Dream Studio www.mx111.com
' Example parameter 1 parameter 2 parameter meaning
' S 5 etc divided into 5 files
' E 1024 split file according to 1024 size
' F 1024 to the top 1024 bytes Save as a file
' L 1024 to save the last 1024 bytes as a file
Dim Tf,sf,fname,soufile,desfolder, Soption, Snum, FSO, FS, SFS
If WScript.Arguments.Count < 3 Then
WScript.Echo "parameter is wrong!"
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