It replaces every instance of something in a text file with something else.
Something is defined, not by telling the program what to look for, but by telling it how to identify what it's looking for, and what it's replaced with is defined, not by telling the program what to replace things with, but by telling it how to determine what to replace things with (as needed).
Obviously, there are languages that do this: PERL, Ruby ... This could be a documentation problem: How to use PERL ... for a particular kind of thing ... replacing every instance of ... ...
As usual, I see the solution, whatever other characteristics it might have, as residing in an exploration of the most basic elements of the problem, and those are: The proposed program open the desired file, and begins to read it. It's looking for a combination of characters we have specified. How do we tell it what combination to look for?
I looked at the file I'm working with, and just telling it to replace every instance of the letter combination "pictures" with the letter combination "minis" would do fine. I might be able to do that with Word, but I don't feel like trying it. I'm just going to do it by hand ... 100 times. The only problem with using word, though, might be that the letter combinations are not separate words. They're nested in longer words. Can Word find letter combinations that are parts of longer words? I just don't feel like working with Word right now.
Ok, I'm done doing it by hand. (Highlighting each instance of "pictures" and pasting in "minis".) It took about two minutes.
Saturday, December 6, 2008
Subscribe to:
Comments (Atom)