10 Replies Latest reply on Nov 26, 2009 8:03 AM by lamp

    Search text in a field

    lamp

      Title

      Search text in a field

      Post

      Dear All,

      I am using FM 9

      Is there any way we can search a field for a specific work or number then put the found number into variable for example.

       

      I have a filed like has text like "This is title<!--   [if gte mso 9]&amp;gt;&amp;lt;xml&amp;gt; &amp;lt;o:DocumentProperties&amp;gt;   &amp;lt;o:Template&amp;gt;Normal.dotm&amp;lt;/o:Template&amp;gt;   &amp;lt;o:Revision&amp;gt;0&amp;lt;/o:Revision&amp;gt;   &amp;lt;o:TotalTime&amp;gt;0&amp;lt;/o:TotalTime&amp;gt;   &amp;lt;o:Pages&amp;gt;1&amp;lt;/o:Pages&amp;gt;   &amp;lt;o:Characters&amp;gt;2&amp;lt;/o:Characters&amp;gt;   &amp;lt;o:Company&amp;gt;Deminos&amp;lt;/o:Company&amp;gt;   &amp;lt;o:Lines&amp;gt;1&amp;lt;/o:Lines&amp;gt;   &amp;lt;o:Paragraphs&amp;gt;1&amp;lt;/o:Paragraphs&amp;gt;   &amp;lt;o:CharactersWithSpaces&amp;gt;2&amp;lt;/o:CharactersWithSpaces&amp;gt;   &amp;lt;o:Version&amp;gt;12.0&amp;lt;/o:Version&amp;gt; &amp;lt;/o:DocumentProperties&amp;gt; &amp;lt;o:OfficeDocumentSettings&amp;gt;   &amp;lt;o:AllowPNG/&amp;gt; &amp;lt;/o:OfficeDocumentSettings&amp;gt; &amp;lt;/xml&amp;gt;&amp;lt;![endif]   --><!--   [if gte mso 9]&amp;gt;&amp;lt;xml&amp;gt; &amp;lt;w:WordDocument&amp;gt;   &amp;lt;w:Zoom&amp;gt;0&amp;lt;/w:Zoom&amp;gt;   &amp;lt;w:TrackMoves&amp;gt;false&amp;lt;/w:TrackMoves&amp;gt;   &amp;lt;w:TrackFormatting/&amp;gt;   &amp;lt;w:PunctuationKerning/&amp;gt;   &amp;lt;w:DrawingGridHorizontalSpacing&amp;gt;18 pt&amp;lt;/w:DrawingGridHorizontalSpacing&amp;gt;   &amp;lt;w:DrawingGridVerticalSpacing&amp;gt;18 pt&amp;lt;/w:DrawingGridVerticalSpacing&amp;gt;   &amp;lt;w:DisplayHorizontalDrawingGridEvery&amp;gt;0&amp;lt;/w:DisplayHorizontalDrawingGridEvery&amp;gt;   &amp;lt;w:DisplayVerticalDrawingGridEvery&amp;gt;0&amp;lt;/w:DisplayVerticalDrawingGridEvery&amp;gt;   &amp;lt;w:ValidateAgainstSchemas/&amp;gt;   &amp;lt;w:SaveIfXMLInvalid&amp;gt;false&amp;lt;/w:SaveIfXMLInvalid&amp;gt;   &amp;lt;w:IgnoreMixedContent&amp;gt;false&amp;lt;/w:IgnoreMixedContent&amp;gt;   &amp;lt;w:AlwaysShowPlaceholderText&amp;gt;false&amp;lt;/w:AlwaysShowPlaceholderText&amp;gt;   &amp;lt;w:Compatibility&amp;gt;    &amp;lt;w:BreakWrappedTables/&amp;gt;    &amp;lt;w:DontGrowAutofit/&amp;gt;    &amp;lt;w:DontAutofitConstrainedTables/&amp;gt;    &amp;lt;w:DontVertAlignInTxbx/&amp;gt;   &amp;lt;/w:Compatibility&amp;gt; &amp;lt;/w:WordDocument&amp;gt; &amp;lt;/xml&amp;gt;&amp;lt;![endif]   --><!--   [if gte mso 9]&amp;gt;&amp;lt;xml&amp;gt; &amp;lt;w:LatentStyles DefLockedState=&amp;quot;false&amp;quot; LatentStyleCount=&amp;quot;276&amp;quot;&amp;gt; &amp;lt;/w:LatentStyles&amp;gt; &amp;lt;/xml&amp;gt;&amp;lt;![endif]   --><!--   /* Font Definitions */ @font-face      {font-family:Arial;      panose-1:2 11 6 4 2 2 2 2 2 4;      mso-font-charset:0;      mso-generic-font-family:auto;      mso-font-pitch:variable;      mso-font-signature:3 0 0 0 1 0;} @font-face      {font-family:Cambria;      panose-1:2 4 5 3 5 4 6 3 2 4;      mso-font-charset:0;      mso-generic-font-family:auto;      mso-font-pitch:variable;      mso-font-signature:3 0 0 0 1 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal      {mso-style-parent:&amp;quot;&amp;quot;;      margin-top:0cm;      margin-right:0cm;      margin-bottom:10.0pt;      margin-left:0cm;      mso-pagination:widow-orphan;      font-size:12.0pt;      font-family:&amp;quot;Times New Roman&amp;quot;;      mso-ascii-font-family:Cambria;      mso-fareast-font-family:Cambria;      mso-hansi-font-family:Cambria;      mso-bidi-font-family:&amp;quot;Times New Roman&amp;quot;;} p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph      {margin-top:0cm;      margin-right:0cm;      margin-bottom:10.0pt;      margin-left:36.0pt;      mso-add-space:auto;      mso-pagination:widow-orphan;      font-size:12.0pt;      font-family:&amp;quot;Times New Roman&amp;quot;;      mso-ascii-font-family:Cambria;      mso-fareast-font-family:Cambria;      mso-hansi-font-family:Cambria;      mso-bidi-font-family:&amp;quot;Times New Roman&amp;quot;;} p.MsoListParagraphCxSpFirst, li.MsoListParagraphCxSpFirst, div.MsoListParagraphCxSpFirst      {mso-style-type:export-only;      margin-top:0cm;      margin-right:0cm;      margin-bottom:0cm;      margin-left:36.0pt;      margin-bottom:.0001pt;      mso-add-space:auto;      mso-pagination:widow-orphan;      font-size:12.0pt;      font-family:&amp;quot;Times New Roman&amp;quot;;      mso-ascii-font-family:Cambria;      mso-fareast-font-family:Cambria;      mso-hansi-font-family:Cambria;      mso-bidi-font-family:&amp;quot;Times New Roman&amp;quot;;} p.MsoListParagraphCxSpMiddle, li.MsoListParagraphCxSpMiddle, div.MsoListParagraphCxSpMiddle      {mso-style-type:export-only;      margin-top:0cm;      margin-right:0cm;      margin-bottom:0cm;      margin-left:36.0pt;      margin-bottom:.0001pt;      mso-add-space:auto;      mso-pagination:widow-orphan;      font-size:12.0pt;      font-family:&amp;quot;Times New Roman&amp;quot;;      mso-ascii-font-family:Cambria;      mso-fareast-font-family:Cambria;      mso-hansi-font-family:Cambria;      mso-bidi-font-family:&amp;quot;Times New Roman&amp;quot;;} p.MsoListParagraphCxSpLast, li.MsoListParagraphCxSpLast, div.MsoListParagraphCxSpLast      {mso-style-type:export-only;      margin-top:0cm;      margin-right:0cm;      margin-bottom:10.0pt;      margin-left:36.0pt;      mso-add-space:auto;      mso-pagination:widow-orphan;      font-size:12.0pt;      font-family:&amp;quot;Times New Roman&amp;quot;;      mso-ascii-font-family:Cambria;      mso-fareast-font-family:Cambria;      mso-hansi-font-family:Cambria;      mso-bidi-font-family:&amp;quot;Times New Roman&amp;quot;;} @page Section1      {size:612.0pt 792.0pt;      margin:72.0pt 90.0pt 72.0pt 90.0pt;      mso-header-margin:36.0pt;      mso-footer-margin:36.0pt;      mso-paper-source:0;} div.Section1      {page:Section1;}    --><!--   [if gte mso 10]&amp;gt; &amp;lt;style&amp;gt; /* Style Definitions */ table.MsoNormalTable      {mso-style-name:&amp;quot;Table Normal&amp;quot;;      mso-tstyle-rowband-size:0;      mso-tstyle-colband-size:0;      mso-style-noshow:yes;      mso-style-parent:&amp;quot;&amp;quot;;      mso-padding-alt:0cm 5.4pt 0cm 5.4pt;      mso-para-margin:0cm;      mso-para-margin-bottom:.0001pt;      mso-pagination:widow-orphan;      font-size:12.0pt;      font-family:&amp;quot;Times New Roman&amp;quot;;      mso-ascii-font-family:Cambria;      mso-ascii-theme-font:minor-latin;      mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;      mso-fareast-theme-font:minor-fareast;      mso-hansi-font-family:Cambria;      mso-hansi-theme-font:minor-latin;      mso-bidi-font-family:&amp;quot;Times New Roman&amp;quot;;      mso-bidi-theme-font:minor-bidi;      mso-ansi-language:EN-US;} &amp;lt;/style&amp;gt; &amp;lt;![endif]   --><!--   StartFragment   --> AC5647<!--   EndFragment   --><!--   [if gte mso 9]&amp;gt;&amp;lt;xml&amp;gt; &amp;lt;o:DocumentProperties&amp;gt;   &amp;lt;o:Template&amp;gt;Normal.dotm&amp;lt;/o:Template&amp;gt;   &amp;lt;o:Revision&amp;gt;0&amp;lt;/o:Revision&amp;gt;   &amp;lt;o:TotalTime&amp;gt;0&amp;lt;/o:TotalTime&amp;gt;   &amp;lt;o:Pages&amp;gt;1&amp;lt;/o:Pages&amp;gt;   &amp;lt;o:Characters&amp;gt;2&amp;lt;/o:Characters&amp;gt;   &amp;lt;o:Company&amp;gt;Deminos&amp;lt;/o:Company&amp;gt;   &amp;lt;o:Lines&amp;gt;1&amp;lt;/o:Lines&amp;gt;   &amp;lt;o:Paragraphs&amp;gt;1&amp;lt;/o:Paragraphs&amp;gt;   &amp;lt;o:CharactersWithSpaces&amp;gt;2&amp;lt;/o:CharactersWithSpaces&amp;gt;   &amp;lt;o:Version&amp;gt;12.0&amp;lt;/o:Version&amp;gt; &amp;lt;/o:DocumentProperties&amp;gt; &amp;lt;o:OfficeDocumentSettings&amp;gt;   &amp;lt;o:AllowPNG/&amp;gt; &amp;lt;/o:OfficeDocumentSettings&amp;gt; &amp;lt;/xml&amp;gt;&amp;lt;![endif]   --><!--   [if gte mso 9]&amp;gt;&amp;lt;xml&amp;gt; &amp;lt;w:WordDocument&amp;gt;   &amp;lt;w:Zoom&amp;gt;0&amp;lt;/w:Zoom&amp;gt;   &amp;lt;w:TrackMoves&amp;gt;false&amp;lt;/w:TrackMoves&amp;gt;   &amp;lt;w:TrackFormatting/&amp;gt;   &amp;lt;w:PunctuationKerning/&amp;gt;   &amp;lt;w:DrawingGridHorizontalSpacing&amp;gt;18 pt&amp;lt;/w:DrawingGridHorizontalSpacing&amp;gt;   &amp;lt;w:DrawingGridVerticalSpacing&amp;gt;18 pt&amp;lt;/w:DrawingGridVerticalSpacing&amp;gt;   &amp;lt;w:DisplayHorizontalDrawingGridEvery&amp;gt;0&amp;lt;/w:DisplayHorizontalDrawingGridEvery&amp;gt;   &amp;lt;w:DisplayVerticalDrawingGridEvery&amp;gt;0&amp;lt;/w:DisplayVerticalDrawingGridEvery&amp;gt;   &amp;lt;w:ValidateAgainstSchemas/&amp;gt;   &amp;lt;w:SaveIfXMLInvalid&amp;gt;false&amp;lt;/w:SaveIfXMLInvalid&amp;gt;   &amp;lt;w:IgnoreMixedContent&amp;gt;false&amp;lt;/w:IgnoreMixedContent&amp;gt;   &amp;lt;w:AlwaysShowPlaceholderText&amp;gt;false&amp;lt;/w:AlwaysShowPlaceholderText&amp;gt;   &amp;lt;w:Compatibility&amp;gt;    &amp;lt;w:BreakWrappedTables/&amp;gt;    &amp;lt;w:DontGrowAutofit/&amp;gt;    &amp;lt;w:DontAutofitConstrainedTables/&amp;gt;    &amp;lt;w:DontVertAlignInTxbx/&amp;gt;   &amp;lt;/w:Compatibility&amp;gt; &amp;lt;/w:WordDocument&amp;gt; &amp;lt;/xml&amp;gt;&amp;lt;![endif]   --><!--   [if gte mso 9]&amp;gt;&amp;lt;xml&amp;gt; &amp;lt;w:LatentStyles DefLockedState=&amp;quot;false&amp;quot; LatentStyleCount=&amp;quot;276&amp;quot;&amp;gt; &amp;lt;/w:LatentStyles&amp;gt; &amp;lt;/xml&amp;gt;&amp;lt;![endif]   --><!--   /* Font Definitions */ @font-face      {font-family:Arial;      panose-1:2 11 6 4 2 2 2 2 2 4;      mso-font-charset:0;      mso-generic-font-family:auto;      mso-font-pitch:variable;      mso-font-signature:3 0 0 0 1 0;} @font-face      {font-family:Cambria;      panose-1:2 4 5 3 5 4 6 3 2 4;      mso-font-charset:0;      mso-generic-font-family:auto;      mso-font-pitch:variable;      mso-font-signature:3 0 0 0 1 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal      {mso-style-parent:&amp;quot;&amp;quot;;      margin-top:0cm;      margin-right:0cm;      margin-bottom:10.0pt;      margin-left:0cm;      mso-pagination:widow-orphan;      font-size:12.0pt;      font-family:&amp;quot;Times New Roman&amp;quot;;      mso-ascii-font-family:Cambria;      mso-fareast-font-family:Cambria;      mso-hansi-font-family:Cambria;      mso-bidi-font-family:&amp;quot;Times New Roman&amp;quot;;} p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph      {margin-top:0cm;      margin-right:0cm;      margin-bottom:10.0pt;      margin-left:36.0pt;      mso-add-space:auto;      mso-pagination:widow-orphan;      font-size:12.0pt;      font-family:&amp;quot;Times New Roman&amp;quot;;      mso-ascii-font-family:Cambria;      mso-fareast-font-family:Cambria;      mso-hansi-font-family:Cambria;      mso-bidi-font-family:&amp;quot;Times New Roman&amp;quot;;} p.MsoListParagraphCxSpFirst, li.MsoListParagraphCxSpFirst, div.MsoListParagraphCxSpFirst      {mso-style-type:export-only;      margin-top:0cm;      margin-right:0cm;      margin-bottom:0cm;      margin-left:36.0pt;      margin-bottom:.0001pt;      mso-add-space:auto;      mso-pagination:widow-orphan;      font-size:12.0pt;      font-family:&amp;quot;Times New Roman&amp;quot;;      mso-ascii-font-family:Cambria;      mso-fareast-font-family:Cambria;      mso-hansi-font-family:Cambria;      mso-bidi-font-family:&amp;quot;Times New Roman&amp;quot;;} p.MsoListParagraphCxSpMiddle, li.MsoListParagraphCxSpMiddle, div.MsoListParagraphCxSpMiddle      {mso-style-type:export-only;      margin-top:0cm;      margin-right:0cm;      margin-bottom:0cm;      margin-left:36.0pt;      margin-bottom:.0001pt;      mso-add-space:auto;      mso-pagination:widow-orphan;      font-size:12.0pt;      font-family:&amp;quot;Times New Roman&amp;quot;;      mso-ascii-font-family:Cambria;      mso-fareast-font-family:Cambria;      mso-hansi-font-family:Cambria;      mso-bidi-font-family:&amp;quot;Times New Roman&amp;quot;;} p.MsoListParagraphCxSpLast, li.MsoListParagraphCxSpLast, div.MsoListParagraphCxSpLast      {mso-style-type:export-only;      margin-top:0cm;      margin-right:0cm;      margin-bottom:10.0pt;      margin-left:36.0pt;      mso-add-space:auto;      mso-pagination:widow-orphan;      font-size:12.0pt;      font-family:&amp;quot;Times New Roman&amp;quot;;      mso-ascii-font-family:Cambria;      mso-fareast-font-family:Cambria;      mso-hansi-font-family:Cambria;      mso-bidi-font-family:&amp;quot;Times New Roman&amp;quot;;} @page Section1      {size:612.0pt 792.0pt;      margin:72.0pt 90.0pt 72.0pt 90.0pt;      mso-header-margin:36.0pt;      mso-footer-margin:36.0pt;      mso-paper-source:0;} div.Section1      {page:Section1;}    --><!--   [if gte mso 10]&amp;gt; &amp;lt;style&amp;gt; /* Style Definitions */ table.MsoNormalTable      {mso-style-name:&amp;quot;Table Normal&amp;quot;;      mso-tstyle-rowband-size:0;      mso-tstyle-colband-size:0;      mso-style-noshow:yes;      mso-style-parent:&amp;quot;&amp;quot;;      mso-padding-alt:0cm 5.4pt 0cm 5.4pt;      mso-para-margin:0cm;      mso-para-margin-bottom:.0001pt;      mso-pagination:widow-orphan;      font-size:12.0pt;      font-family:&amp;quot;Times New Roman&amp;quot;;      mso-ascii-font-family:Cambria;      mso-ascii-theme-font:minor-latin;      mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;      mso-fareast-theme-font:minor-fareast;      mso-hansi-font-family:Cambria;      mso-hansi-theme-font:minor-latin;      mso-bidi-font-family:&amp;quot;Times New Roman&amp;quot;;      mso-bidi-theme-font:minor-bidi;      mso-ansi-language:EN-US;} &amp;lt;/style&amp;gt; &amp;lt;![endif]   --><!--   StartFragment   --> for test".

      Is there any way I can pick AC5647 for the field and put it in variable?

      In differnt records the numer AC5647 keep changing. 

       

       

      Please let me know if you need more information.

       

      I will appreciate your help

      Thanks

      Lamp

      <!--   [if gte mso 9]&amp;gt;&amp;lt;xml&amp;gt; &amp;lt;o:DocumentProperties&amp;gt;   &amp;lt;o:Template&amp;gt;Normal.dotm&amp;lt;/o:Template&amp;gt;   &amp;lt;o:Revision&amp;gt;0&amp;lt;/o:Revision&amp;gt;   &amp;lt;o:TotalTime&amp;gt;0&amp;lt;/o:TotalTime&amp;gt;   &amp;lt;o:Pages&amp;gt;1&amp;lt;/o:Pages&amp;gt;   &amp;lt;o:Characters&amp;gt;2&amp;lt;/o:Characters&amp;gt;   &amp;lt;o:Company&amp;gt;Deminos&amp;lt;/o:Company&amp;gt;   &amp;lt;o:Lines&amp;gt;1&amp;lt;/o:Lines&amp;gt;   &amp;lt;o:Paragraphs&amp;gt;1&amp;lt;/o:Paragraphs&amp;gt;   &amp;lt;o:CharactersWithSpaces&amp;gt;2&amp;lt;/o:CharactersWithSpaces&amp;gt;   &amp;lt;o:Version&amp;gt;12.0&amp;lt;/o:Version&amp;gt; &amp;lt;/o:DocumentProperties&amp;gt; &amp;lt;o:OfficeDocumentSettings&amp;gt;   &amp;lt;o:AllowPNG/&amp;gt; &amp;lt;/o:OfficeDocumentSettings&amp;gt; &amp;lt;/xml&amp;gt;&amp;lt;![endif]   --><!--   [if gte mso 9]&amp;gt;&amp;lt;xml&amp;gt; &amp;lt;w:WordDocument&amp;gt;   &amp;lt;w:Zoom&amp;gt;0&amp;lt;/w:Zoom&amp;gt;   &amp;lt;w:TrackMoves&amp;gt;false&amp;lt;/w:TrackMoves&amp;gt;   &amp;lt;w:TrackFormatting/&amp;gt;   &amp;lt;w:PunctuationKerning/&amp;gt;   &amp;lt;w:DrawingGridHorizontalSpacing&amp;gt;18 pt&amp;lt;/w:DrawingGridHorizontalSpacing&amp;gt;   &amp;lt;w:DrawingGridVerticalSpacing&amp;gt;18 pt&amp;lt;/w:DrawingGridVerticalSpacing&amp;gt;   &amp;lt;w:DisplayHorizontalDrawingGridEvery&amp;gt;0&amp;lt;/w:DisplayHorizontalDrawingGridEvery&amp;gt;   &amp;lt;w:DisplayVerticalDrawingGridEvery&amp;gt;0&amp;lt;/w:DisplayVerticalDrawingGridEvery&amp;gt;   &amp;lt;w:ValidateAgainstSchemas/&amp;gt;   &amp;lt;w:SaveIfXMLInvalid&amp;gt;false&amp;lt;/w:SaveIfXMLInvalid&amp;gt;   &amp;lt;w:IgnoreMixedContent&amp;gt;false&amp;lt;/w:IgnoreMixedContent&amp;gt;   &amp;lt;w:AlwaysShowPlaceholderText&amp;gt;false&amp;lt;/w:AlwaysShowPlaceholderText&amp;gt;   &amp;lt;w:Compatibility&amp;gt;    &amp;lt;w:BreakWrappedTables/&amp;gt;    &amp;lt;w:DontGrowAutofit/&amp;gt;    &amp;lt;w:DontAutofitConstrainedTables/&amp;gt;    &amp;lt;w:DontVertAlignInTxbx/&amp;gt;   &amp;lt;/w:Compatibility&amp;gt; &amp;lt;/w:WordDocument&amp;gt; &amp;lt;/xml&amp;gt;&amp;lt;![endif]   --><!--   [if gte mso 9]&amp;gt;&amp;lt;xml&amp;gt; &amp;lt;w:LatentStyles DefLockedState=&amp;quot;false&amp;quot; LatentStyleCount=&amp;quot;276&amp;quot;&amp;gt; &amp;lt;/w:LatentStyles&amp;gt; &amp;lt;/xml&amp;gt;&amp;lt;![endif]   --><!--   /* Font Definitions */ @font-face      {font-family:Arial;      panose-1:2 11 6 4 2 2 2 2 2 4;      mso-font-charset:0;      mso-generic-font-family:auto;      mso-font-pitch:variable;      mso-font-signature:3 0 0 0 1 0;} @font-face      {font-family:Cambria;      panose-1:2 4 5 3 5 4 6 3 2 4;      mso-font-charset:0;      mso-generic-font-family:auto;      mso-font-pitch:variable;      mso-font-signature:3 0 0 0 1 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal      {mso-style-parent:&amp;quot;&amp;quot;;      margin-top:0cm;      margin-right:0cm;      margin-bottom:10.0pt;      margin-left:0cm;      mso-pagination:widow-orphan;      font-size:12.0pt;      font-family:&amp;quot;Times New Roman&amp;quot;;      mso-ascii-font-family:Cambria;      mso-fareast-font-family:Cambria;      mso-hansi-font-family:Cambria;      mso-bidi-font-family:&amp;quot;Times New Roman&amp;quot;;} p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph      {margin-top:0cm;      margin-right:0cm;      margin-bottom:10.0pt;      margin-left:36.0pt;      mso-add-space:auto;      mso-pagination:widow-orphan;      font-size:12.0pt;      font-family:&amp;quot;Times New Roman&amp;quot;;      mso-ascii-font-family:Cambria;      mso-fareast-font-family:Cambria;      mso-hansi-font-family:Cambria;      mso-bidi-font-family:&amp;quot;Times New Roman&amp;quot;;} p.MsoListParagraphCxSpFirst, li.MsoListParagraphCxSpFirst, div.MsoListParagraphCxSpFirst      {mso-style-type:export-only;      margin-top:0cm;      margin-right:0cm;      margin-bottom:0cm;      margin-left:36.0pt;      margin-bottom:.0001pt;      mso-add-space:auto;      mso-pagination:widow-orphan;      font-size:12.0pt;      font-family:&amp;quot;Times New Roman&amp;quot;;      mso-ascii-font-family:Cambria;      mso-fareast-font-family:Cambria;      mso-hansi-font-family:Cambria;      mso-bidi-font-family:&amp;quot;Times New Roman&amp;quot;;} p.MsoListParagraphCxSpMiddle, li.MsoListParagraphCxSpMiddle, div.MsoListParagraphCxSpMiddle      {mso-style-type:export-only;      margin-top:0cm;      margin-right:0cm;      margin-bottom:0cm;      margin-left:36.0pt;      margin-bottom:.0001pt;      mso-add-space:auto;      mso-pagination:widow-orphan;      font-size:12.0pt;      font-family:&amp;quot;Times New Roman&amp;quot;;      mso-ascii-font-family:Cambria;      mso-fareast-font-family:Cambria;      mso-hansi-font-family:Cambria;      mso-bidi-font-family:&amp;quot;Times New Roman&amp;quot;;} p.MsoListParagraphCxSpLast, li.MsoListParagraphCxSpLast, div.MsoListParagraphCxSpLast      {mso-style-type:export-only;      margin-top:0cm;      margin-right:0cm;      margin-bottom:10.0pt;      margin-left:36.0pt;      mso-add-space:auto;      mso-pagination:widow-orphan;      font-size:12.0pt;      font-family:&amp;quot;Times New Roman&amp;quot;;      mso-ascii-font-family:Cambria;      mso-fareast-font-family:Cambria;      mso-hansi-font-family:Cambria;      mso-bidi-font-family:&amp;quot;Times New Roman&amp;quot;;} @page Section1      {size:612.0pt 792.0pt;      margin:72.0pt 90.0pt 72.0pt 90.0pt;      mso-header-margin:36.0pt;      mso-footer-margin:36.0pt;      mso-paper-source:0;} div.Section1      {page:Section1;}    --> 

        • 1. Re: Search text in a field
          raybaudi
            

          Hi Lamp

           

          how do you ( and we ) know that the word to pick is "AC5647" and not, for example, "title" ?


          Is it ALWAYS the 4th word ?

          • 2. Re: Search text in a field
            lamp
              

            Thanks for reply.

            Here is my main task to do

             

            I have a database with tables ( Clients, Query, SentEmails and ReceivedEmails) The relation is 

            Query.ClientID=Client.ClientID

             

            Query.QueryID=SendEmail.QueryID

             

            Query.QueryID = ReceivedEmails.QueryID

             

            When I send email form Filemaker Pro I send the QueryID as reference in the subject like "Stationary is posted AC5647 ( AC5647 is QueryID)". For send email the QueryID is taged but when I receive reply email the ReceivedEmails.QueryID is empty. 

             

            I want to run a script when I received reply to copy the QueryID from ReceivedEmail.Subject and put it in Receivedemail.QueryID

             

            The Query Id  in subject is always at the end of the subject field.

             

            Hope I have explaied everything please let me know if you need more information

             

            Thanks

            Lamp

            • 3. Re: Search text in a field
              raybaudi
                

              lamp wrote:

               

              The Query Id  in subject is always at the end of the subject field.


              So you can pick it using the RightWords ( ) function.

               

               

              • 4. Re: Search text in a field
                lamp
                  

                I Can put some thing like

                 

                Go to Related Record [From table: "ReceivedMessage"; Using Layout "ReceivedMessage"(ReceivedMessage)]

                Set Variable [$vgetQueryID; Value:Right (ReceivedMessage::Subject; 6)]

                Set Field [ReceivedMessages::QueryID; $vgetQueryID]

                 

                Because it is the last words of the subject field I can get. Is there any way I can search for AC letter and pick the number?

                 

                Thanks 

                Lamp

                 

                • 5. Re: Search text in a field
                  philmodjunk
                    

                  I noticed that Daniele is suggesting that you use the RightWords function, but you posted an example that uses a function named "Right".

                   

                  The are two functions in filemaker Right and RightWords.

                   

                  Right(text; 1) will return the last letter

                   

                  RightWords(text; 1) will return the last word

                   

                  Given the format of your subject line, Rightwords should be able to do the job easily.

                  • 6. Re: Search text in a field
                    mrvodka
                      

                    You have some contradicting info. Your example does not have it at the end of the statement but yet you state that it is.

                     

                    You can try something like the following:

                     

                    Let ( [ x = yourtext;
                               y = Substitute ( x; [0;"#"]; [2;"#"]; [3;"#"]; [4;"#"]; [5;"#"]; [6;"#"]; [7;"#"]; [8;"#"]; [9;"#"] );
                               s = Position ( y; "AC#"; 1; 1 )
                            ]; Case ( s; LeftWords ( Middle ( x; s; Length ( x ) - s + 1 ); 1 ) ) 

                         )


                    • 7. Re: Search text in a field
                      raybaudi
                        

                      mr_vodka wrote:

                       

                      Let ( [ x = yourtext;         y = Substitute ( x; [0;"#"]; [2;"#"]; [3;"#"]; [4;"#"]; [5;"#"]; [6;"#"]; [7;"#"]; [8;"#"]; [9;"#"] );         s = Position ( y; "AC#"; 1; 1 )        ]; Case ( s; LeftWords ( Middle ( x; s; Length ( x ) - s + 1 ); 1 ) )     )

                       


                      a minor omission:

                      y = Substitute ( x ; [0;"#"]; [1;"#"]; [2;"#"]; [3;"#"]; [4;"#"]; [5;"#"]; [6;"#"]; [7;"#"]; [8;"#"]; [9;"#"] );

                       

                      • 8. Re: Search text in a field
                        mrvodka
                           Eh I dont like 1's. ;)
                        • 9. Re: Search text in a field
                          raybaudi
                            

                          lamp wrote:

                           

                          Is there any way I can search for AC letter and pick the number?


                          If your text field contains ONLY a group of digits ( even starting with zeros ), you can pick it with:

                           

                          Filter ( YourTextField ; 1234567890 )


                          • 10. Re: Search text in a field
                            lamp
                              

                            Thanks a lot for all replies.

                             

                            Dear raybaudi

                            your code worked that is the code I was looking for it.

                             

                            Regards

                            Lamp