OOo Off the Wall: Find and Replace
In long documents, a strong search-and-replace tool is essential for editing duties. Although many users confine themselves to simple text searches, OpenOffice.org's various searches are a match for any rival's. They also are remarkably consistent throughout Writer, Calc, Draw and Impress, the four main OOo applications.
The Find & Replace window is haphazardly arranged into basic options and advanced options that are available when the More Options button is selected. The search options fall into three main categories:
Location searches: searches for text strings that can be limited to specific areas or directions in the document.
Format searches: searches for design elements, sometimes with specific text strings but also without text strings.
Pattern searches: searches for patterns rather than exact text strings.
Although arranged with little logic as various check boxes and buttons, OpenOffice.org's search options provide a quick revision tool for both text and layout.
The basic operation of the Find & Replace tool in Writer is identical to similar tools found in other office applications. The text to search for is entered in the Search for field, and the replacement text--if there is any--goes in the Replace with field.
Searches are started by selecting either the Find or Find All button. If you select the Find button, the application starts at the current position of the cursor and stops successively at each instance of the text you are searching for. When it reaches the end of the document, you have the option to continue from the beginning of the text. Unfortunately, OpenOffice.org applications do not remember the starting point, so reaching the end of the document is the only marker you have for the progress of a search. This limitation makes it advisable to start a search at the beginning of every document.
By contrast, if you select the Find All button, each string that matches the search is highlighted. The text remains highlighted after you close the Find & Replace window.
When you select the Find button and a match is found, selecting the Replace button makes the substitution. Note that if the Replace with field is blank, selecting the Replace button leaves a blank where the match was.
Alternatively, once a search and replace is set up, you can select the Replace All button and have all of the substitutions made in a few seconds. This is a useful feature, but it can lead to disaster if your search is poorly planned. Usually, you are safer using the Find and the Replace buttons for one or two substitutions. Select the Replace All button once you are confident of the results.
Location searches are the most basic types of searches available in OpenOffice.org. As you might guess from the window layout, Whole words only is one of the most basic ways to refine a search. It ensures that results don't include, for example, "orange" when you want "range". Backwards reverses the usual search direction, which always is useful if you get ahead of yourself with multiple instances. Current selection only limits the search to the text selected with the mouse. All these location specifiers are available throughout OpenOffice.org.
Calc, the spreadsheet program, contains additional location specifiers. Entire cells is Calc's equivalent of Whole words only. It sets the search for cells that match what is entered in the Search for field rather than strings of characters. Calc searches also can be limited by Search in, which confines the search to formulas, values or notes. And, in addition to Backwards, Calc also includes Search direction, which sets whether the spreadsheet is scanned by rows or by columns. Usually, Calc searches are confined to the current sheet, but you can broaden a search by selecting Search in all sheets.
A history for the two fields in the Find & Replace window is available from its drop-down list. You can use the history to repeat a search quickly.
-- Bruce Byfield (nanday)
Trending Topics
| You Need A Budget | Feb 10, 2012 |
| The Linux powered LAN Gaming House | Feb 08, 2012 |
| Creating a vDSO: the Colonel's Other Chicken | Feb 06, 2012 |
| Your CMS Is Not Your Web Site | Feb 01, 2012 |
| Casper, the Friendly (and Persistent) Ghost | Jan 31, 2012 |
| Razor-qt 0.4 - Qt based Desktop Environment | Jan 30, 2012 |
- I didn't knew this thing by
1 hour 53 min ago - Author's reply
5 hours 18 min ago - Link to modlys
6 hours 25 min ago - I use YNAB because of the
6 hours 36 min ago - Search
11 hours 39 min ago - Question
12 hours 2 min ago - for the record
12 hours 5 min ago - That's disappointing. Thanks
14 hours 28 min ago - Well spotted. I've corrected
15 hours 57 min ago - This is a great program. We
18 hours 57 min ago







Comments
OOo Off the Wall: Find and Replace
Great article on Find and Replace.Thanks for sharing.wristbands
OOo Off the Wall: Find and Replace
Great article on Find and Replace.Thanks for sharing.wristbands
The OO Community Needs to Stop Kidding Itself
The find/replace operations in Open Office simply don't compare to those in Microsoft's products. The description here proves it -- only a programmer could love all these arbitrary symbols (which are not readily provided in the relevant dialog box). And any doubt is erased by the comments. I want to love OO, I really do, but after wrestling with a plain text document for several hours to get it ready for importation into Calc, I finally surrendered to reality, opened Word, and had it nicely displayed in Calc in about three minutes. The developers really need to take a hard look at this feature, because I would guess it's a deal-killer for a lot of potential adopters -- me included, so far.
First I want to be able to see all the nonprinting characters in my document. OO does fine here, or at least Writer does. But then I want to be able to conduct find and replace operations that correspond directly to what I'm seeing on the screen. None of this "empty paragraph" vs. "paragraph" stuff. A carriage return is a carriage return as far as the user is concerned, and OO's failure to see it that way is sure to bewilder anybody except programmers. Ideally a user could select a displayed nonprinting character, copy it, and paste it right into the dialog box. Failing that (which even Word won't do), I want some simple, intuitive codes for these characters, readily available right in the dialog box.
And I want them to operate predictably. Word has this just about right. If I'm looking at a document with a bunch of paragraph symbols in it, I can replace every one of them with anything I want by searching on ^p. Same with tabs (^t). A very common operation for me is to first mark the real paragraph breaks in a document by replacing double carriage returns (^p^p) with some arbitrary string (e.g., {*NEWPARAGRAPH*}), then stripping out all the other carriage returns, and then restoring the real paragraph breaks by reversing the original operation. Just try this with OO and see if you have not torn out all your hair before you give up in disgust, as I have done repeatedly.
I don't know if this problem originates in the underlying paradigms or algorithms or whatever. I do know that I have encountered similar frustrations with gedit, the default Gnome (Linux) text editor. All I know is, whatever the source of the difficulty, it doesn't seem to have kept the folks in Redmond from coming up with a search utility that any user can understand and use effectively. The same simply can't be said for OO, and until it can, I have to keep a copy of that Redmond product on my system.
In word processing,
In word processing, preparation and editing of large document is a common activity. The Open Office is an ideal companion for this purpose. It has all the powerful tools required to create and edit large documents. Among these the Find and Replace dialogue, is very important. It provides the writer the ability to search and replace a particular word or string of words hassle free. This option is also available for other applications of the Open Office. It can be used to change the fond or fond size of a particular word or words that spread through out the large document very easily. This tool is very helpful and a time saviour. ecommerce fulfillment
sed command
The find and replace can be used and redirected to the same file and input file,
in this case input and outfile will be same
using -i option with sed command
sed -i 's/bar/foo/g' newfile.txt
here in all places the bar will be replaced by foo
Make a recommendation...
The writer makes a point of saying the find features are "haphazardly arranged" and "arranged with little logic", but there is no suggestion about why he thinks this is the case, nor is any suggestion made for changing the organization.
Overall the article was beneficial, but support for the assertion would have made it just a smidgeon better.
"Logical" arrangement recommendation
I Agree.
Perhaps we could start by using the structure of this article as a guide to what would make the arrangement more "logical"?
First of all, the "Match Case" and "Whole words only"/"Entire Cell" check boxes probably do belong where they are, even if they could be grouped with the rest below, because they are likely to be very commonly used. Also "Search for Styles", though less used, could go with these because it affects what appears in the "Search for" and "Replace with" text boxes.
When the "More Options" button is pressed and the dialog expands, the check boxes and buttons could be grouped according to the type of search to perform (that is, a Location, Format or Patern search), probably broken up with horizontal rules and headings "Search by Location", "Search by Format" and "Search Expressions".
The merrits of this arrangement are probably open to debate, as is the discussion of whether this is more or less "logical" than the current arrangement. I think in this discussion we should keep in mind what would be most useful when performing searches. Having read the article, the Find & Replace feature now makes sense to me, and I personally feel that an arrangement like above could be better than the current, though if someone else wants to better it, then please go for it.
OOo not just for kernelmonkeys
I strongly suggest the editorial staff see the wisdom in sharing this great content with the TUX folks. Arguably, that is a better audience anyway.
find and replace for
find and replace for non-printing characters is baloney. every suggestion has not worked
I agree - I have to go back
I agree - I have to go back to Word to use find & replace to remove paragraph breaks for instance
have to check "regular expressions" box
I was similarly confused why it didn't work when I tried to search on "$". I eventually figured out that you have to check the "Regular expressions" (whatever the heck _that_ means!) box under the "More Options" button. Ridiculous.
Sorry OO, MS Word is smarter on this one. "^p" "^l" and "^t" are intuitive. "$", "/n" and "[:space:]" are so _non-intuitive_, I can't imagine what on earth the programmers were thinking.