The TXT text cutter that supports dragging implemented by vbs

Source: Internet
Author: User

Splitfile. vbs
'/* =================================================== ==========================================
'* Intro. TXT text cutter. The default value is 8000 characters, which is partitioned into one file. Drag is supported.
'* Filename splitfile. vbs
'* Author yongfa365
'* Version V1.0
'* Madetime 2008-04-24 12:58:43
'* Lastmodify 2008-04-24 12:58:43
'* ===================================================== ============================================= */

Set objargs = wscript. Arguments
If objargs. Count = 0 then
Iiiii inputbox ("select the text file to be processed", "select the text file to be processed ")
Else

For i001 = 0 to objargs. Count-1
Iiiii objargs (i001)
Next
End if

Function IIIII (PATH)
Tempstr = readfromfile (path, "gb2312 ")
Length = Len (tempstr)
IIi = 0
For II = 0 to length step 8000 '8000 characters into a file
IIi = III + 1
Writetofile left (path, Len (PATH)-4) & "_" & right ("00" & III, 3 )&". TXT ", mid (tempstr, II + 1, 8000)," gb2312"
Next
End Function

Function readfromfile (fileurl, charset)
Dim Str
Set STM = Createobject ("ADODB. Stream ")
STM. type = 2
STM. mode = 3
STM. charset = charset
STM. Open
STM. loadfromfile fileurl
STR = STM. readtext
STM. Close
Set STM = nothing
Readfromfile = Str
End Function

'Store files according to the specified Encoding

function writetofile (fileurl, STR, charset)
set STM = Createobject ("ADODB. stream ")
STM. type = 2
STM. mode = 3
STM. charset = charset
STM. open
STM. writetext STR
STM. savetofile fileurl, 2
STM. flush
STM. close
set STM = nothing
end function

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.