PDA

View Full Version : Search for text in html documents.


Raindog
02-19-2003, 04:25 AM
Hi!
I have a CD filled with HTML files and I like to find files by searching with key-words that will match text in the HTML files.
Now I can only search for the filename.
I would be happy if someone could help me.
Eric

<IR_ACTIONS_LIST>
<Action name="Remove">
<Type>120</Type>
<Function>0</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<TargetListBox>ListBox1</TargetListBox>
<RemoveType>1</RemoveType>
<Index/>
<IndexDelimiter>;;</IndexDelimiter>
</Action>
<Action name="Blank Line">
<Type>203</Type>
<Function>2</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
</Action>
<Action name="Get Text">
<Type>78</Type>
<Function>0</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<Variable>%ObjectText%</Variable>
<ObjectName>sök1</ObjectName>
</Action>
<Action name="Search">
<Type>18</Type>
<Function>0</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<Variable>%Files%</Variable>
<Delimiter>;;</Delimiter>
<FileName>*%ObjectText%*.*</FileName>
<LocalFixedDrives>0</LocalFixedDrives>
<RemoteDrives>0</RemoteDrives>
<RemovableDrives>0</RemovableDrives>
<CDROMDrives>0</CDROMDrives>
<SpecificDirectoriesDrives>1</SpecificDirectoriesDrives>
<CustomDirectoriesDrives>%SrcDir%</CustomDirectoriesDrives>
<RecurseCustom>1</RecurseCustom>
<DialogTitle>Searching for Files</DialogTitle>
<DialogText>Searching for files. This may take a few moments.</DialogText>
<ShowDialog>1</ShowDialog>
</Action>
<Action name="Add Files">
<Type>119</Type>
<Function>0</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<TargetListBox>ListBox1</TargetListBox>
<AddType>0</AddType>
<Index/>
<ItemToAdd>%Files%</ItemToAdd>
<ItemDelimiter>;;</ItemDelimiter>
<InformationToDisplay>2</InformationToDisplay>
<ShowFileExtension>1</ShowFileExtension>
</Action>
</IR_ACTIONS_LIST>

Worm
02-19-2003, 09:40 AM
You could open each file and search for the string. If you get a hit, store the filename in a global list. Then show the filenames in the global list for the results.

kpsmith
02-19-2003, 03:30 PM
You could also build a delimited text file that indexes the HTML pages and search using this.

Essentially the file (index.txt) would like something like this

Page1.HTM:::Text within the html file
Page2.HTM:::Text within the html file
Page3.HTM:::Text within the html file

You would then search the index file and if you get a hit store the Page.

This would require a bit more work up front but your searching would be faster

Raindog
02-27-2003, 03:10 AM
Thank you for your help.
Eric