| |
meiliong
Posts: 1
Score: 0
Joined: 7/11/2008
Status: offline
|
Original message moved by dm_4ever Reason : Moving to Appropriate Forum I had written a simple script using vbscript to read text file data line by line. On top of that i would like to grab the read data and perform calculation such as get the total sum. The data that i read is an integer. How should i continue from this? For example the data i got from this script are 1,2,3,4,5 i need to sum all these datas 1+2+3+4+5=15. Please help. Thank you Const ForReading = 1 Set objFSO = CreateObject("Scripting.FileSystemObject") Set objTextFile = objFSO.OpenTextFile _ ("c:\test2\test.txt", ForReading) Do Until objTextFile.AtEndOfStream strNextLine = objTextFile.Readline arrServiceList = Split(strNextLine , ",") For i = 3 to Ubound(arrServiceList) Wscript.Echo "Service: " & arrServiceList(i) Next Loop
|
|