dbTalk Databases Forums  

Find/Replace empty field

comp.databases.filemaker comp.databases.filemaker


Discuss Find/Replace empty field in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Diego B
 
Posts: n/a

Default Find/Replace empty field - 05-03-2007 , 09:50 PM






Hi,

I have added a new field to an old DB (FM 8.5 adv. Win XP) and I would
like to fill it up with a pre-specified text string ("Yes" as
example), but I do not know how to use the Find/Replace function in
Edit to do that. In practice, FM should detect if the field of that
particula record is empty and replace a text string inside. Should I
use a script with If/then loop ? Might you explain how to do that ??

Thanks a lot

Diego


Reply With Quote
  #2  
Old   
Helpful Harry
 
Posts: n/a

Default Re: Find/Replace empty field - 05-04-2007 , 01:27 AM






In article <1178247014.099546.180360 (AT) h2g2000hsg (DOT) googlegroups.com>,
Diego B <messadua (AT) yahoo (DOT) it> wrote:

Quote:
Hi,

I have added a new field to an old DB (FM 8.5 adv. Win XP) and I would
like to fill it up with a pre-specified text string ("Yes" as
example), but I do not know how to use the Find/Replace function in
Edit to do that. In practice, FM should detect if the field of that
particula record is empty and replace a text string inside. Should I
use a script with If/then loop ? Might you explain how to do that ??

Thanks a lot

Diego
You don't need the Find / Replace command. Assuming there even is that
ability in newer versions of FileMaker, it will be for replacing one
piece of text with another (just like a word processor), not an empty
field.

There are two ways you can do this though, and a looping script isn't
needed. Both of these methods assume you already have the new field
defined and that it currently doesn't have any data in it (or at least
no data that is still wanted).

A. Calculation
- Go into the Define Fields window and change the new field
to be a Calculation field (Text result) and define the
calculation as simply:
"Yes"

- Click on the Done buttons until you have closed the Define
Fields window. Wait for the records to be calculated, which
might take a while if there are lots of them

- Go back inot the Define Field window and change the field
back to a Text field. It will retain the existing "Yes"
data in each record.

- All done.


B. Replace Command
- In Layout mode, put the field onto any layout using normal
field formatting.

- Go back to Browse mode and choose "Show All Records" from
the Records menu.

- Click in the new field and type in "Yes" (without the
quote / speech marks) - do not exit the field, leave the
text cursor in it.

- Choose Replace from the Records menu.

- In the window that appears, make *100%* sure that it says
you are replacing the contents of the correct field with
the "Yes" text, and then click on the Replace button.

- All done. You can now remove the field from the layout if
you don't want it there.



No matter which method you use, if you want all new records to also be
set to "Yes" then remember aftwerwards to also define the final Text
field to use an Auto-enter by Calculation of just "Yes".






Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)


Reply With Quote
  #3  
Old   
Diego B
 
Posts: n/a

Default Re: Find/Replace empty field - 05-04-2007 , 05:59 PM



On May 4, 1:27 am, Helpful Harry <helpful_ha... (AT) nom (DOT) de.plume.com>
wrote:
Quote:
In article <1178247014.099546.180... (AT) h2g2000hsg (DOT) googlegroups.com>,

Diego B <messa... (AT) yahoo (DOT) it> wrote:
Hi,

I have added a new field to an old DB (FM 8.5 adv. Win XP) and I would
like to fill it up with a pre-specified text string ("Yes" as
example), but I do not know how to use the Find/Replace function in
Edit to do that. In practice, FM should detect if the field of that
particula record is empty and replace a text string inside. Should I
use a script with If/then loop ? Might you explain how to do that ??

Thanks a lot

Diego

You don't need the Find / Replace command. Assuming there even is that
ability in newer versions of FileMaker, it will be for replacing one
piece of text with another (just like a word processor), not an empty
field.

There are two ways you can do this though, and a looping script isn't
needed. Both of these methods assume you already have the new field
defined and that it currently doesn't have any data in it (or at least
no data that is still wanted).

------------- Cut -----------


All right !

First of all thank you for the quinck and complete reply. The problem
is that I violated one of the two
prerequisites to use your ways, that is the field has some values that
I would like to keep. As I sayd there are records in which
the filed is empty but there are others in which has a value different
from "Yes" (as example "No"). I would like to keep all those values
and replace
only the empty records...is that still possible in your way, or should
I go for a script ?

Thank you again

Diego

Quote:
Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)



Reply With Quote
  #4  
Old   
Helpful Harry
 
Posts: n/a

Default Re: Find/Replace empty field - 05-04-2007 , 06:34 PM



In article <1178319589.292661.225490 (AT) w5g2000hsg (DOT) googlegroups.com>,
Diego B <messadua (AT) yahoo (DOT) it> wrote:

Quote:
On May 4, 1:27 am, Helpful Harry <helpful_ha... (AT) nom (DOT) de.plume.com
wrote:
In article <1178247014.099546.180... (AT) h2g2000hsg (DOT) googlegroups.com>,

Diego B <messa... (AT) yahoo (DOT) it> wrote:
Hi,

I have added a new field to an old DB (FM 8.5 adv. Win XP) and I would
like to fill it up with a pre-specified text string ("Yes" as
example), but I do not know how to use the Find/Replace function in
Edit to do that. In practice, FM should detect if the field of that
particula record is empty and replace a text string inside. Should I
use a script with If/then loop ? Might you explain how to do that ??

Thanks a lot

Diego

You don't need the Find / Replace command. Assuming there even is that
ability in newer versions of FileMaker, it will be for replacing one
piece of text with another (just like a word processor), not an empty
field.

There are two ways you can do this though, and a looping script isn't
needed. Both of these methods assume you already have the new field
defined and that it currently doesn't have any data in it (or at least
no data that is still wanted).

------------- Cut -----------


All right !

First of all thank you for the quinck and complete reply. The problem
is that I violated one of the two
prerequisites to use your ways, that is the field has some values that
I would like to keep. As I sayd there are records in which
the filed is empty but there are others in which has a value different
from "Yes" (as example "No"). I would like to keep all those values
and replace
only the empty records...is that still possible in your way, or should
I go for a script ?

Thank you again

Diego
In this case the Calculation method won't work since that does change
ALL records. Instead you can still use the Replace command which only
works on the records in the Found Set:

- First, make a BACKUP of the file just in case something
goes wrong. (A step I missed out before, but one that
should ALWAYS be done before making major changes to
existing data / files.)

- In Layout mode, put the field onto any layout using normal
field formatting (or change the existing field to Normal
formatting).

- Next find the records where the field is empty:

- Enter Find mode.

- Type an = symbol into the field.

- Perform the Find.

- It is only these Found records that will be
changed.

- Then perform the Replace Command process without the
Show All step:

- Click in the new field and type in "Yes"
(without the quote / speech marks) - do not
exit the field, leave the text cursor in it.

- Choose Replace from the Records menu.

- In the window that appears, make *100%* sure
that it says you are replacing the contents
of the correct field with the "Yes" text, and
then click on the Replace button.

- All done. You can now remove the field from
the layout if you don't want it there, or
change it back to Radio Button, etc.



Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)


Reply With Quote
  #5  
Old   
Diego B
 
Posts: n/a

Default Re: Find/Replace empty field - 05-05-2007 , 04:03 PM




Quote:
In this case the Calculation method won't work since that does change
ALL records. Instead you can still use the Replace command which only
works on the records in the Found Set:

- First, make a BACKUP of the file just in case something
goes wrong. (A step I missed out before, but one that
should ALWAYS be done before making major changes to
existing data / files.)

- In Layout mode, put the field onto any layout using normal
field formatting (or change the existing field to Normal
formatting).

- Next find the records where the field is empty:

- Enter Find mode.

- Type an = symbol into the field.

- Perform the Find.

- It is only these Found records that will be
changed.

- Then perform the Replace Command process without the
Show All step:

- Click in the new field and type in "Yes"
(without the quote / speech marks) - do not
exit the field, leave the text cursor in it.

- Choose Replace from the Records menu.

- In the window that appears, make *100%* sure
that it says you are replacing the contents
of the correct field with the "Yes" text, and
then click on the Replace button.

- All done. You can now remove the field from
the layout if you don't want it there, or
change it back to Radio Button, etc.


It works great !! Thank you so much : )

Quote:
Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)- Hide quoted text -

Diego



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.