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

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you change the icon and otherwise manipulate the DOS box?

1173


which property used to add a menus at runtime?

1559


what is the Property used to add a menus at runtime?

1722


Explain about conditional operators?

667


How would you attach an ActiveX control in Your Application?

1689






What is the default workspace?

1749


Can you tell me the properties of the controls?

1665


what are the Differences between Recordset and Resultsets?

2113


by writing MACRO CODE,i want to retrive data from one spead sheet to another UI (workbook). control will search cell by cell for each row and load the data in another workbook(UI). ex: custdetails custname lastname locaton mobile pincode custdetails raj tony hyd 555555 521245 servcreqrd srvce# srvcename location srvcepincode servcreqrd 754 drilling hyd 521784 for the above example in the another workbook retrive data like this custname Raj srvce# 754 srvcepincode 521784. while retrieving data control will search cell by cell for each row.

1770


What is ODBC Direct and Microsoft Jet Database Engine ?

1565


How would you create Visual basic Document file?

2003


How many ways you can access file using VB?

658


What are 3 main differences between flexgrid control and dbgrid control?

1999


VB ActiveX: Create a "drivelist"(D1) box, a "folderlistbox"(FLD1) that changes whenever D1 is changed , and a "FilelistBox"(FIL1) that is populated with the file lists under the selected directory in (D1).The file selected is stored in a variable "filename" along with the path. Question: How to use this activeX control in VC++ to get the selected filename?

1630


What is the use of Hyperlink control for DHTML applications?

1503