Since you have a text file (or csv), perhaps the easiest way to fix
things is in a editor (like emacs - which you used) or using a language
like awk, sed, perl, or even bash if you're on Linux. awk is
particularly suited to these kinds of problems. You can do amazing
things clearly in a few lines of code once you get the hang of it.
Versions are available for multiple platforms.
Joe
Arctic Fidelity wrote:
On Mon, 06 Feb 2006 18:49:01 -0600, Ross Johnson
<[EMAIL PROTECTED]> wrote:
On Mon, 2006-02-06 at 18:20 -0600, Arctic Fidelity wrote:
On Mon, 06 Feb 2006 16:48:05 -0600, G. Roderick Singleton
<[EMAIL PROTECTED]> wrote:
> On Mon, 06 Feb 2006 15:44:06 -0600, Arctic Fidelity wrote:
>
>> I'm trying to do a search and replace using regular expressions on a
>> single selection of cells in OpenOffice.Org 2.0.1. It's not working.
>> :-P I
>> am working on tab-delimited files, and am trying to insert a
string into
>> the beginning of each of the cells. In all the other programs I use,
>> this
>> is done by using:
>>
>> Search: ^
>> Replace: string
>>
>> But this claims that there were no results found.
>>
>> Instead, I thought I could do this:
>>
>> Search: ^(.)
>> Replace: String \1
>
> You should be able to do so.
Well, it does in most other implementations of REs, but in OOo it's a
little different/strange. I had to read the help page on REs very
carefully to realise that () and \1 etc are used only in the search
term, and \1 is not used in the replace term. E.g. () and \n are used
like this: '(A)BC\1\1\1' will match 'ABCAAA'.
To long-time RE hackers this is a little unexpected. What you need is
this:
Search: ^.
Replace: String &
I don't know what you do if you want to carry more than one sub-string
match over to your replace string.
All I have to say to that is: BAH HUMBUG! :-P I find that to be
rather...disconcerting and completely useless. ;-) Alright, not
completely useless, but fairly useless. This is almost a big enough
problem to make me want to go in and fix it myself. I mean, I'm glad
they put in Regexp's in the whole searching thing, but why on earth
would they limit the possibility of the searches like that? I pretty
much ONLY use regexp's when I have to work on a problem like this one,
or, more commonly, having more than one substring to retain in the
replace function.
In the end I fixed it by using Emacs instead. :-P
- Arctic
--Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]