Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use vbs to get the count of items in a text file

Shulou Source: shulou.com Published: 2022-06-03 19:38:04 11月12日 Update

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!

Tags: Documents text code content more knowledge practicality achievement and then dilemma reality situation articles cases editing websites industries processes high quality learning Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi macOS Shulou Information Docker MySQL