reading lines from a file by searching a word(instr) and
copying to other textfile,but its only copying only one
line but there are some other lines match criteria but not
copying to the files

Answers were Sorted based on User's Feedback



reading lines from a file by searching a word(instr) and copying to other textfile,but its only co..

Answer / senthilg

givenstring=f1.Readall

Do
If InStr(st_pos, givenstring, "<indexTerm>") <> 0 Then
st_pos = InStr(st_pos, givenstring, ""<indexTerm>")
close_pos = InStr(st_pos, givenstring, "</indexTerm>")
find_String = Mid(givenstring, st_pos, (close_pos -
st_pos) + Len("</indexTerm>"))
st_pos=close_pos +1
End If

Loop While InStr(st_pos, givenstring, "<indexTerm>") <> 0


'Start String =<indexTerm>
'End String =</indexTerm>

Is This Answer Correct ?    1 Yes 1 No

reading lines from a file by searching a word(instr) and copying to other textfile,but its only co..

Answer / pradeep kumar

Read each line in a loop, campare with required string with
instr and concatenat the whole line

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Visual Basic Interview Questions

To populate a single column value which dbcontrols you to use?

0 Answers  


How many tabs in a tabbed dialog do you consider appropriate?

0 Answers  


How would you access objects created in ActiveX Exe and ActiveX Dll

0 Answers  


How do we call MS- Excel in VB?

3 Answers  


Which property of textbox cannot be changed at runtime. What is the max size of textbox?

0 Answers  






How to find size of the file. Which method or function is used to occomplish this?

1 Answers  


What is the use of Immediate, Local Window?

1 Answers  


How to use advanced data-bound controls.

0 Answers  


What is the benefit of wrapping database calls into MTS transactions?

1 Answers  


How do I set the Windows wallpaper at runtime?

0 Answers  


If we can make more than one MDI Form in VB then How? I need to make 2 MDI Forms in my project.

2 Answers   HST, Infosys,


How to use hyperlink?

0 Answers  


Categories