sunday is sunday
monday
tuesday
wendesday
sunday
thursday
friday
saturday
sunday
sunday

how to count no of sunday in the text file from vb? Answer
me asap

Answer Posted / eswar

cnt =0
Set fso = CreateObject("scripting.filesystemobject")
Set f = fso.opentextfile("D:\test.txt",1)
While f.atendofstream<>true
x = f.readline
y = Split(x," ")
For i=0 to ubound(y)

If y(i) = "sunday" Then
cnt=cnt+1
End If
Next
Wend
MsgBox cnt

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which command is used for writing text on a page?

578


Out of the different type of operators, which are evaluated first and last in the vbscript language?

567


i need to sort the data using qtp script for this how i need to write a qtp script

3222


Hello friends..... Can any give the methods for Ms-Access, and Mozilla firefox in Automation Object Model in QTP. Please give me currect answers... if you do not understand my question please don't give answers. Thanking you.

1852


Explain the string concatenation function in vbscript?

544






What are the 2 ways to pass a value to the function?

518


I need to get some data from data base and store this (retrieved) data in a excel sheet using VB script in QTP9.0 I have created connection for data base I have created as excels sheet by using Set XL=CreateObject("Excel.Application") XLworksheet.cells(1,1).value= rs.fields.item("<>") I have taken a for loop and changed the cells values (1 as i and another 1 as j) But still I am not able to get Plz kindly tell me know this . It is very urgent

1773


We have 1 web page with names column. I am giving the Service Providers1,2,3.... @ that time dynamically some no of names are displaying in the webpage and The Pop up windows are opening(No.of Pop Up windows=No.of Names). The names may be diffar for each and every Service Provders (Dynamically) How can we handle the Dynamic values?

1756


What is the purpose of the err object in the vbscript language?

630


How do i automate a website www.flyashx.com without having any test cases witin a week time.

1461


What are class events?

583


how to automatically update the sql server2005 database records when insert in vb6?

1489


When are redim statement and preserve keyword used in the vbscript language?

602


How to open browser in vb script?

586


Which in-built functions are used to convert the specified expression in the form of date and string in the vbscript language?

546