China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-07-16 16:10
中国DOS联盟论坛 » 论坛回收站 » VBS seeking help View 2,191 Replies 5
Original Poster Posted 2010-10-02 20:42 ·  中国 安徽 滁州 电信
新手上路
Credits 5
Posts 5
Joined 2010-10-01 21:32
15-year member
UID 175175
Gender Male
Status Offline
```vbnet
Const ForReading = 1 'Set the text opening mode to read
Const ForWriting = 2 'Set the text opening mode to write
Const ForAppending = 8 'Set the text opening mode to append

Const InFile = "a.txt" 'Set the text to open

Dim i, Sum
Dim StrLine, OutStr1, OutStr2
i = 1: Sum = 0

'On Error Resume Next

Set objFSO = CreateObject("Scripting.FileSystemObject") 'Reference the FSO object, which is needed for reading and writing files
Set objFile = objFSO.OpenTextFile(InFile, ForReading) 'Open InFile in read mode

Do Until objFile.AtEndOfStream
StrLine = objFile.ReadLine 'Read a line
If Len(StrLine) Then 'If it's not an empty line
'MsgBox Mid(StrLine, Len(StrLine) - 58, 1) Test (commented out).
If Mid(StrLine, Len(StrLine) - 58, 1) = "1" Then 'Should the count from the end be correct?
OutStr1 = OutStr1 & StrLine & vbCrLf
Else
OutStr2 = OutStr2 & StrLine & vbCrLf
End If
End If
Loop

objFile.Close 'Close the file object


Set objFile = objFSO.OpenTextFile("a1.txt", ForWriting, True)
objFile.Write OutStr1
objFile.Close

Set objFile = objFSO.OpenTextFile("a2.txt", ForWriting, True)
objFile.Write OutStr2
objFile.Close

Set objFile = Nothing
Set objFSO = Nothing

[ Last edited by wangsky100 on 2010-10-2 at 20:43 ]
```
Floor 2 Posted 2010-10-02 20:46 ·  中国 安徽 滁州 电信
新手上路
Credits 5
Posts 5
Joined 2010-10-01 21:32
15-year member
UID 175175
Gender Male
Status Offline
Can it be changed to

1: Copy the second line of the text to a1.txt

2: Copy all content after Introduction: to a2.txt

[ Last edited by wangsky100 on 2010-10-2 at 20:48 ]
Floor 3 Posted 2010-10-02 20:50 ·  中国 安徽 滁州 电信
新手上路
Credits 5
Posts 5
Joined 2010-10-01 21:32
15-year member
UID 175175
Gender Male
Status Offline
The content on the top of the building is the website's essence index content. Author: slore. Please help solve it if you can, thanks a lot!!!
Floor 4 Posted 2010-10-02 20:51 ·  中国 安徽 滁州 电信
新手上路
Credits 5
Posts 5
Joined 2010-10-01 21:32
15-year member
UID 175175
Gender Male
Status Offline
Director: Director
Starring: Seann William Scott, Chow Yun-fat, Jaime King
Genre: Action
Region: Europe and America region
Language: Classification
Year: Release
Length:
Introduction:  In this film, Chow Yun-fat plays a nameless mysterious monk. He comes from Tibet, China. For 60 years, he has been shouldering an important task - protecting a mysterious ancient scripture scroll, which is a martial arts secret book inscribed with ancient Chinese scriptures, containing extremely powerful strange power. As long as you get this power, you can be invincible in the world. Countless people with evil intentions have either once or are currently coveting it. In order not to let the scroll fall into the hands of the evil and do harm to the world, the nameless martial artist walks away and his footprints spread all over the north and south of the Yangtze River. brbr  Now the nameless martial artist feels that the years are passing, so he actively looks for an excellent apprentice and wants to pass on the task of protecting the scroll. Coincidentally, a street gangster Carl (Seann William Scott) who does nothing all day long actually saves the nameless martial artist from a group of gangsters by chance. Maybe it's really the arrangement of fate in the dark. The martial artist firmly believes that this little rascal Carl who looks grinning and completely has no sense of responsibility is his best apprentice, so he decides to teach Carl all his unfathomable legendary martial arts. But Carl obviously scorns this "master" who falls from the sky. Before Carl awakens to his destined mission in this life, the nameless martial artist must lead him, and with the help of a beautiful, sexy and a little sense of justice female thief (Jemie King), join hands to fight against those who try to forcefully take and grab the mysterious scripture scroll,

Can become
1: Copy the second line of the text to a1.txt
2: Copy all the content after Introduction: to a2.txt

[ Last edited by wangsky100 on 2010-10-2 at 21:05 ]
Floor 5 Posted 2010-10-02 20:53 ·  中国 安徽 滁州 电信
新手上路
Credits 5
Posts 5
Joined 2010-10-01 21:32
15-year member
UID 175175
Gender Male
Status Offline
Const InFile = "a.txt" 'Set the text to open

It is best that the red part is not restricted to the text name, because each text name is different. If possible, it is best
(Text such as a.txt, b.txt, 123.txt, movie.txt........)

[ Last edited by wangsky100 on 2010-10-2 at 20:56 ]
Floor 6 Posted 2010-10-03 13:03 ·  中国 重庆 电信
版主
★★★★★
Credits 9,023
Posts 5,017
Joined 2007-05-31 19:39
19-year member
UID 89899
Gender Male
Status Offline
Forum Jump: