I am last year BSc(I.T) student. I am learning programming language. I want to know how to count the number of character which is present in the file?
I am last year BSc(I.T) student. I am learning programming language. I want to know how to count the number of character which is present in the file?
I do not know of any direct way of determining the number of characters in a text file. You can use the following very simple code for Count the Number of Characters:
Code:Const ForReading = 1 Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFile = objFSO.OpenTextFile("C:ScriptsTest.txt", ForReading) strCharacters = objFile.ReadAll strCharacters = Replace(strCharacters, vbCrLf, "") Wscript.Echo Len(strCharacters) objFile.Close
Bookmarks