The code of dividing and merging text file with vbs

Time:2020-1-15

The code of dividing and merging text file with vbs
However, it is very slow to import tens of thousands of addresses at one time when downloading again in other places, so it is necessary to divide it: (in this TXT file, one address takes up one line)
Content of url_split.vbs file:

Copy codeThe code is as follows:
Set fs =CreateObject(“scripting.filesystemobject”)
Set gs =CreateObject(“scripting.filesystemobject”)
Set F = fs.opentextfile (“URL. TXT”, 1, true) ‘url.txt is the txt file to be split, which contains tens of thousands of addresses
n=0
do while f.atendofstream<>true
n=n+1
data=””
Set G = GS. Opentextfile (CSTR (n) + “. LST”, 2, true) ‘the split file is saved as: 1. LST 2. LST 3. LST
if f.atendofstream<>true then
For a = 1 to 1000 ‘after splitting, a file saves 1000 addresses
data=f.readline
g.writeline data
next
end if

loop
f.close
g.close

Hehe, this VBS is to divide the file by the unit of behavior, how to divide the file by the unit of bytes? Welcome to discuss with me!
The code of dividing and merging text file with vbs

Recommended Today

RCAST 35: add type to currency

– font ALT: Simsun; MSO font charset: 134; mso-generic-font-family:auto; mso-font-pitch:variable; mso-font-signature:3 680460288 22 0 262145 0;} @font-face {font-family:”Cambria Math”; panose-1:2 4 5 3 5 4 6 3 2 4; mso-font-charset:1; mso-generic-font-family:roman; mso-font-format:other; mso-font-pitch:variable; mso-font-signature:0 0 0 0 0 0;} @font-face {font-family:Calibri; Variable; Ose-1: 216301111; mso-font-charset:134; mso-generic-font-family:auto; mso-font-pitch:variable; mso-font-signature:3 680460288 22 0 262145 0;} /\* Style […]