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

write a program to display the system specifications of client system with the help of vb script.

1 Answers  


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

0 Answers  


How to identify column in VSFlexgrid? My VSFlexgrid window is identified as 'Active X Control'

0 Answers  


write a text script to display * as below ********** **** **** *** *** ** ** * * * * ** ** *** *** **** **** **********

1 Answers  


How to scroll down a page while recording in qtp. suggest me any method apart from low level recording.

0 Answers  






Explain about filter expression?

0 Answers  


What are class variables?

0 Answers  


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

1 Answers   Microsoft,


Hi this is Vinoth. I need a help on below mentioned question A combobox contains list of items assume as 5 I have to get each items Individually and I have to Export to datatable. Please help me on this. Thanks

0 Answers  


How strcomp function works?

0 Answers  


The function template cocept is implemented in vb.net is ???

0 Answers  


write a vb script to generate 3*3 matrix

2 Answers  


Categories