Thursday, 11 December 2008

8: Find

If you're used to excel, or word, or any normal 'find' system, you're used to the idea that 'find' and 'find and replace' are pretty much the same thing. In textpad, they're not. 

F5 opens the 'find' window
F8 opens the 'find and replace' window

First up: Find. The find window looks like this:



Let's look at the options here:

'Text'. 'Hex' means 'Hexadecimal', and is advanced stuff. Always select 'Text'.

'Match whole words' means exactly that - match sets of characters that end with a space, a full-stop (or other punctuation), or a tab. This is very handy - it means that if you search for 'cat' it will find the exact word 'cat' and not 'concatenate'. Leave this box ticked.

'Match case' means exactly that - it will match capital and lower-case letters. This is handy if you want to find March (the month) but not march (walking in formation). It will mess up your results if you leave it on - a search for 'Animal' will not find 'animal' if this box is ticked. Usually, leave this box unticked.

 3. 'Regular expression'. When you check this box, you turn regexes on and off. If it's ticked, \t means 'tab'. If it's not, \t literally means \t. If your regex doesn't work, it is often because this box is not ticked. Always make sure this box matches what you want to do.

4. 'Wrap searches'. Textpad starts finding from the cursor mark and stops at the bottom of the document, which can be annoying. If you tick this box, it will go to the bottom, then back to the top and start again - which means the whole document gets searched. Leave this box ticked. 


Direction: Up and Down. If you really only want to search in one direction from the cursor point (i.e. not a wrap seach), you can choose the direction here. These are used infrequently.

Extend selection and In all documents. You can search is selected text, or in more than one open document, using these buttons. These are used infrequently.


...and now, the 'Go' buttons:

Find next means 'show me the next match after the cursor' (easy)

Mark all means 'put a marker next to all the matches in the file.' 

Mark all is super handy. Super, super, super handy - I cannot stress enought how handy it is. Read all about it in the next post.

No comments: