How to use vbs to get the count of items in a text file
This article introduces the knowledge of "how to use vbs to get the count of items in a text file". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
The copy code is as follows:
Const ForReading = 1 Const ForWriting = 2 Set objFSO = CreateObject ("Scripting.FileSystemObject") Set objFile = objFSO.OpenTextFile ("C:\ Scripts\ Test.txt", ForReading) strContents = objFile.ReadAll objFile.Close strFirstLine = "This is the new first line in the text file." StrNewContents = strFirstLine & vbCrLf & strContents Set objFile = objFSO.OpenTextFile ("C:\ Scripts\ Test.txt", ForWriting) objFile.WriteLine strNewContents objFile.Close "how to use vbs to get the item count in a text file" ends here, thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!