3 Replies Latest reply on Jul 7, 2015 1:28 PM by philmodjunk

    Word Count in fields



      Word Count in fields


      I am trying to subtract words from a field. The problem is ever item in a field has a different amount of words. I have a word count field but it count all the words in a field. For example in my Product name field i have the below:

      French Break-fronted Inlay Chest, Cherry  w. 42”, d. 21”, ht. 36 ½”

      I want jus: French Break-fronted Inlay Chest

      The problem is every item name has a different amount of words and filemaker counts everything besides the separators as words. Any suggestions would help

        • 1. Re: Word Count in fields

          It seems the content of your field, not the number of words is what is relevant to your problem.

          Can you describe a "rule" that indicates which words you want to keep and which that you do not? Is there a consistent format? For example, does the text that you don't want always start as "w. " or perhaps "w. " followed by a numeric digit?

          • 2. Re: Word Count in fields

            That is the problem. Here are some products i want to change in the field:

            Item Name
            French Break-fronted Inlay Chest, Cherry  w. 42”, d. 21”, ht. 36 ½”
            Three Draw English Chest in Port w. 35”, d. 17”, ht. 33”
            English Four Draw Mahogany Chest w/Tier w. 28”, d. 18”, ht. 28 ½”
            Italian Chest in Gessow. 42”, d. 21 ½”, ht. 37 ½”
            Italian Flush Top Cherry Chestw. 26”, d. 16 ½”, ht. 29”
             British Isle Chest, Aged Pine *New Item*     w. 32.5”  d. 18”  ht. 33.5”   
            English Channel Mahogany Chest  w. 36”, d. 19”, ht. 34 ½”  
            Northern Italian Mahogany Chestw. 41 ¼”, d. 19 ½”, ht. 35”
            Cherry French Table w/ Tierw. 32 ½”, d. 18”, ht. 33 ½”
            French Cabinet w/ Marble, Cherry *New Item*     w.49.5”, d. 18”, ht. 39”
            French Cabinet in Gesso w/Grille w. 61”, d. 21”, ht. 88”
            Mahogany Georgian Bookcase *New Item*    w. 54.5”, d. 18.5”, ht. 91”                                         
            French Cherry Draw Leaf Table l. 70” (opens to 112”), w. 38”                             
            Round Dining Table in Pine   *New Item*    diameter 62”, ht. 30”                                   
            Regency, Marble Cocktail Table, (in Mahogany Port)w. 54”, d. 30”, ht. 19 ½” 

            I just want the name not the dimensions. The dimensions are for another field. I do not want to go threw 20,000 products to change this.

            • 3. Re: Word Count in fields

              But given the messy data that you have to work with, I don't really see that you have any real choice but to engage in at least some manual editing of the data. I can come up with a way to drop out all numeric characters or possibly all characters except a-z in upper and lower case plus space characters with Trim to remove the trailing spaces. But this will leave the units of your dimensions in place at the end of the remaining text string.

              And the example of:

              Northern Italian Mahogany Chestw. 41 ¼”, d. 19 ½”, ht. 35”

              is especially troublesome as their is not even a space between the text you want to keep and the text you want to discard.