November 22, 201114 yr I have a text field called "Sample HTML Code" that contains the following contents: <tbody class="result"> <tr> <td> <span>Price not displayed.<span class="tiny"> <a href="/gp/feature.html?ie=UTF8&docId=174014">Why?</a></span></span> <div class="shipping_block"><span class="price_shipping">+ $150.00</span><span class="word_shipping">shipping</span></div> <tbody class="result"> <tr> <td> <span class="price">$1,616.42</span> <div class="shipping_block"><span class="price_shipping">+ $113.49</span><span class="word_shipping">shipping</span></div> I Want to remove a portion of this text field and just delete it. The text portion being: "</span></span> <div class="shipping_block"><span class="price_shipping">+" I want to leave the rest of the field intact and just delete that one section. Should I create a script or calculation/script trigger? Additionally, how do you remove just a section of text from a field in filemaker?
November 22, 201114 yr Let( losetext="[b]</span></span>[/b] <div class="shipping_block"><span class="price_shipping">+"; Substitute(MyTextField; losetext;"") ) You may have to insert the pilcrow (¶) character in place of the newline characters in the text.
November 22, 201114 yr Author No Dice, I've added a sample file, yet cannot get it deleted with that set of code SampleA.fp7.zip
November 23, 201114 yr I repaired your sample. As I said, the newline characters had to be replaced with ¶. Because (probably) the text was copied and pasted from an actual HTML file, there were a lot of space characters interspersed. I had to take the text from your field and paste it into a text editor that showed invisible characters. I then made the substitution. I also had to escape the quotation marks within the text with \.
November 23, 201114 yr Author Still having trouble reproducing the results. Do you have the repaired file?
Create an account or sign in to comment