3 Replies Latest reply on Dec 27, 2010 12:46 PM by philmodjunk

    Find/Replace Blank Fields Within A Record



      Find/Replace Blank Fields Within A Record


      I have a handful of records with 100+ blank fields in each record.  I want to replace all the blank fields with the same text ("0") without having to do each field individually.

      I tried using the "Find/Replace" option and under "find" I typed in "=" (for blank) and "replace" I typed in "0" but it's not working.  It states that it didn't find any "=" fields. 


        • 1. Re: Find/Replace Blank Fields Within A Record

          Operators such as = are used with performing finds not find/replace. To use = to find a record with a blank field, you'd enter find mode, type an = in the field, then perform the find. This only searches on the field where you entered the operator so you'd have to do this once for each of you 100+ fields. Once you've found such a group of records, you can use replace field contents to put a 0 in this one field for all the records thus found. 

          You might want to craft a script to both find and update your fields to reduce the monotony involved.

          With Find/Replace the finds search for example text and I can't see any way to use it to search for blank fields. If you are reading this and know of a way, please post as it would save a lot of effort here.

          • 2. Re: Find/Replace Blank Fields Within A Record

            Yes, I figured "=" wasn't working in this case (as you said it only works during find mode), but I thought I would give it a shot.

            I do know how to find/replace fields across multiple records using "replace field contents" but I figured there must be a way to do this for multiple fields within the same record.

            It seems like such a simple thing, but I can't figure it out.

            • 3. Re: Find/Replace Blank Fields Within A Record

              You might consider a script like this:

              Go To Field [specify the first field in the layout's tab order]
                 Enter Find mode []
                 Insert Text ["="]
                 Set Error Capture [on]
                 perform Find []
                 If [ Get ( FoundCount ) > 0 ]
                    Replace Field Contents [no dialog ; "0"]
                 End If
                 Go To Field [next]
                 Exit loop if [ Get ( ActiveFieldName ) = "name of first field in tab order"]
              End Loop

              As with all trials using Replace Field Contents, make a back up copy first so you can toss the file and try again if it doesn't work the way you expected.