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

Answers were Sorted based on User's Feedback



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

Answer / siva

text="sunday is sunday monday tuesday wendesday sunday
thursday friday saturday sunday sunday how to count no of
sunday"
coun=ubound(split(text,"sunday"))
msgbox coun

Is This Answer Correct ?    4 Yes 0 No

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

Answer / siva

Set fso=createobject("scripting.filesystemobject")
Set forread=fso.OpenTextFile("path\test.txt",1)
text=forread.ReadAll
coun=ubound(split(text,"sunday"))
msgbox coun

Is This Answer Correct ?    2 Yes 0 No

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

Answer / sha

Thanks siva

Is This Answer Correct ?    0 Yes 0 No

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

Answer / 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

More VB Script Interview Questions

What are the uses of vb script?

0 Answers  


How do you write an SQL insert statement?

4 Answers   HCL,


Explain How do you create a recordset object in vbscript?

0 Answers  


How to remove the spaces in a string Ex: "this is apple"

5 Answers   Cap Gemini,


generic function for webedit box for web application

1 Answers  






How to find a latest file from any folder

3 Answers   Ness Technologies,


Which event is triggered when mouse focus comes out of an element in the vbscript language?

0 Answers  


Anyone have qtp11.0 crack?

0 Answers  


who will create the object?

0 Answers   TCS,


Develop a parameterized action that accomplishes the following a. Launch a browser of users choice ( example : IE, chrome etc) b. Open up a search engine (Google, Bing etc) c. Perform a search d. Click a particular link depending on the user’s choice ( 1st , 2nd or third link)

0 Answers   TCS, Wipro,


Here in my automation tool, i am retreiving some values and i need to store this values in the excel. How can i achieve this?. We are using VBA as scripting language. please let me know if you require any further inputs.

1 Answers  


What is the equivalent of VBScript?s On Error In Jscript ?

1 Answers   Microsoft,


Categories