|
wangsky100
新手上路

积分 5
发帖 5
注册 2010-10-1
状态 离线
|
『楼 主』:
VBS求教
使用 LLM 解释/回答一下
Const ForReading = 1 '设定打开文本方式为读取
Const ForWriting = 2 '设定打开文本方式为写入
Const ForAppending = 8 '设定打开文本方式为追加
Const InFile = "a.txt" '设定打开的文本
Dim i,Sum
Dim StrLine,OutStr1,OutStr2
i = 1:Sum = 0
'On Error Resume Next
Set objFSO = CreateObject("Scripting.FileSystemObject") '引用FSO对象,读写文件要用到的
Set objFile = objFSO.OpenTextFile(InFile, ForReading) '以读取方式打开InFile
Do Until objFile.AtEndOfStream
StrLine = objFile.ReadLine '读取一行
If Len(StrLine) Then '如果不是空行
'MsgBox Mid(StrLine,Len(StrLine) - 58,1) 测试用的(已注释掉)。
If Mid(StrLine,Len(StrLine) - 58,1) = "1" Then '倒数应该对的吧?
OutStr1 = OutStr1 & StrLine & vbCrLf
Else
OutStr2 = OutStr2 & StrLine & vbCrLf
End If
End If
Loop
objFile.Close '关闭文件对象
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 ]
```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 ]
```
|
|
2010-10-2 20:42 |
|
|
wangsky100
新手上路

积分 5
发帖 5
注册 2010-10-1
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
能不能变成
1:拷贝文本第二行 到 a1.txt
2:拷贝文本 简介:后所有内容到a2.txt
Last edited by wangsky100 on 2010-10-2 at 20:48 ]
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 ]
|
|
2010-10-2 20:46 |
|
|
wangsky100
新手上路

积分 5
发帖 5
注册 2010-10-1
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
楼顶内容为网站精华索引内容 作者: slore 请有会的同学帮忙解决下 感激不尽!!!
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!!!
|
|
2010-10-2 20:50 |
|
|
wangsky100
新手上路

积分 5
发帖 5
注册 2010-10-1
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
导演:导演
主演:西恩·威廉·斯科特 周润发 杰米·金
类型:动作
地区:欧美地区地区
语言:分类
年份:上映
片长:
简介: 在本片中,发哥饰演一位没有名字的神秘僧侣,他来自中国西藏,60年来,一直担负着重任——保护一卷神秘的古经卷轴,那是以中国古代经文刻写而成的武功秘籍,蕴藏无比强大的奇异力量,只要得到这种力量,就可以无敌于天下,无数心怀叵测的人都曾经或正在觊觎着它。为了不让卷轴落入奸恶之徒的手里,为祸人间,无名武僧避而出走,足迹遍及大江南北。 brbr 如今无名武僧自觉岁月流逝,于是积极物色高徒,想将保护卷轴的任务传承下去。事有凑巧,一个终日无所事事的街头混混卡尔(西恩·威廉·斯科特),居然阴错阳差地从一群歹徒手中救下了无名武僧,也许真的是冥冥中命运的安排,武僧坚信这个看起来嬉皮笑脸、完全没有责任感的小痞子卡尔就是自己最好的传人,于是决定把自己深不可测的传奇武功尽数传授给卡尔,但是卡尔对这个天下掉下来的“师傅”显然嗤之以鼻,在卡尔对自己今生注定的使命觉醒之前,无名武僧必须带领他,再加上一名美貌性感还有那么点正义感的女神偷(洁美·金)的相助,联手对抗企图强取抢夺神秘经卷、
能不能变成
1:拷贝文本第二行 到 a1.txt
2:拷贝文本 简介:后所有内容到a2.txt
Last edited by wangsky100 on 2010-10-2 at 21:05 ]
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 ]
|
|
2010-10-2 20:51 |
|
|
wangsky100
新手上路

积分 5
发帖 5
注册 2010-10-1
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
Const InFile = "a.txt" '设定打开的文本
红字的地方 最好能不限制文本名 因为每个文本名都不一样 如果能作到最好
(文本比如a.txt ,b.txt 123.txt 电影.txt ........)
Last edited by wangsky100 on 2010-10-2 at 20:56 ]
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 ]
|
|
2010-10-2 20:53 |
|
|
HAT
版主
       
积分 9023
发帖 5017
注册 2007-5-31
状态 离线
|
|
2010-10-3 13:03 |
|
|