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

How would you define and use a Boolean in VB?

2 Answers   Asteroid Software Services, Microsoft,


Explain the creation project schedule.

0 Answers  


How can you save and Get data from Clipboard?

1 Answers  


What is RdExecDirect?

1 Answers  


What is meant by building a recordset.

0 Answers  


___,___ and __ are difference between image and picture controls.

0 Answers  


Types of Modal windows in VB.

1 Answers  


What are some methods you can use to send data from one VB executable to another one?

0 Answers  


what is the difference between vb and vb.net

2 Answers  


Timer control contains ________ no. of events.

0 Answers  


How does the following statements work? On Error Resume Next

1 Answers  


How can I speed up my VB database application?

0 Answers  


Categories