Groups > Databases > Filemaker > Re: replace nothing




Re: replace nothing

Re: replace nothing
Wed, 19 Mar 2008 11:58:45 -070
On 2008-03-19 11:20:38 -0700, Bill Steele <ws21@cornell.edu> said:

> Find/Replace allows you to change the contents of something in a field
> throughout all records. But it won't allow you to add something that
> isn't there.
> E.g., find "foo" replace with "bar" makes the change in
the selected
> field in all records.
> 
> But find "" replace with "foo."  Returns 0 times. Any
way to do that?

If the field you're trying to fill with "foo" is entirely empty, do a

find in the field for "=" and then do a manual or calculated replace 
with the desired string just on the found set.

If you're searching inside a text string for "" then you're out of
luck.

In find mode, in the status bar at the left, there is a pulldown 
labeled "Symbols" that will tell you all the operators you can use for

finds.
-- 
Lynn Allen
--
www.semiotics.com
Member Filemaker Business Alliance
Long Beach, CA
Post Reply
Re: replace nothing
Wed, 19 Mar 2008 14:17:55 -070
On Mar 19, 11:20 am, Bill Steele <w...@cornell.edu> wrote:
> Find/Replace allows you to change the contents of something in a field
> throughout all records. But it won't allow you to add something that
> isn't there.
> E.g., find "foo" replace with "bar" makes the change in
the selected
> field in all records.
>
> But find "" replace with "foo."  Returns 0 times. Any
way to do that?

Such a find/replace doesn't make any sense. There are an infinite
number of empty substrings before, after, and between every character
in every field. To do a find and replace on them is non-sensical.

Its essentially the same problem as looking at a basket and saying,
"How many times can I remove 0 apples?" The bucket contains an
infinite number of empty sets of apples. So you can do this an
infinite number of times.

I suspect you want to replace the contents of fields that are actually
empty, not find empty substrings.

If that's the case, Lynn's suggestion of finding empty fields, and
then replacing them using the "Find" with an = sign in the field, and
then replacing them with a value would work.

Alternatively you can do a replace by calculation on each field you
are interested in where the calculation is either:

if(isempty(field); "foo"; field)

or

if(field=""; "foo";field)

Either of those will check if the field IS empty (instead of merely
containing empty substrings of which there are infinite in any
field).and if so set it to "foo", else it will leave it as it was.

-cheers,
Dave

Post Reply
replace nothing
Wed, 19 Mar 2008 14:20:38 -040
Find/Replace allows you to change the contents of something in a field 
throughout all records. But it won't allow you to add something that 
isn't there.  
E.g., find "foo" replace with "bar" makes the change in the
selected 
field in all records. 

Post Reply
Re: replace nothing
Thu, 20 Mar 2008 18:03:03 +010
Bill Steele <ws21@cornell.edu> wrote:

> Find/Replace allows you to change the contents of something in a field
> throughout all records. But it won't allow you to add something that 
> isn't there.  
> E.g., find "foo" replace with "bar" makes the change in
the selected 
> field in all records. 
> 
> But find "" replace with "foo."  Returns 0 times. Any
way to do that?

If the field is empty, it is quite simple:
Fill the replace text into this field in only one record,
then this text is pre-choosed in the replace dialog
and you have only to "replace" with one klick in all records.

So I did in FileMaker 8.5.

Greetings
Post Reply
Re: replace nothing
Thu, 20 Mar 2008 20:54:20 -070
On Mar 19, 12:20 pm, Bill Steele <w...@cornell.edu> wrote:
> Find/Replace allows you to change the contents of something in a field
> throughout all records. But it won't allow you to add something that
> isn't there.
> E.g., find "foo" replace with "bar" makes the change in
the selected
> field in all records.
>
> But find "" replace with "foo."  Returns 0 times. Any
way to do that?

I never use Find/Relpace.  I just don't use the Editing script steps
like Cut() and Paste() and Find/Replace.  I use the Replace Field
Contents() instead.  You can manipulate it do accomplish what you want
in this situation.  You Replace Field Contents() by calculation:

Post Reply
<< Previous 1 2 Next >>
( Page 1 of 2 )
about | contact