Jredeemer14 Posted November 22, 2011 Posted November 22, 2011 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?
doughemi Posted November 22, 2011 Posted November 22, 2011 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.
Jredeemer14 Posted November 22, 2011 Author Posted November 22, 2011 No Dice, I've added a sample file, yet cannot get it deleted with that set of code SampleA.fp7.zip
doughemi Posted November 23, 2011 Posted November 23, 2011 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 \.
Jredeemer14 Posted November 23, 2011 Author Posted November 23, 2011 Still having trouble reproducing the results. Do you have the repaired file?
doughemi Posted November 23, 2011 Posted November 23, 2011 Durn! I thought I had attached it yesterday. SampleA Repaired.fp7.zip
Recommended Posts
This topic is 4749 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now