Software Venture Consulting

FileMaker Pro downloads & Resources
FileMaker Custom Functions
FileMaker Web Viewer Examples
FileMaker Pro & Lasso Consulting
Training
FileMaker Books
FileMaker Articles
FileMaker Error Reference

Free Web Tools
Free FileMaker Tools

Personal Pages
Videos
Adventures
Links

Shopping Cart
Shopping Cart

Search:

Free Newsletter
Signup


Contact


Privacy Policy



FileMaker is a registered trademark of FileMaker, Inc. in the U.S. and other countries.

 

 FileMaker Pro Custom Functions

List  |  Show Random  |  Upload  |  Add This to Your Site

HTMLtoText ( text ; returns )

Rate this function:  

RatingRatingRatingRatingRating
  Average rating: 3.8  (59 votes)
  Discuss this Custom Function

Mogens Brun, FM Integrator
http://filemakerintegrator.dk

Convert HTML text to text preserving bold and italic styles (v. 1.04).

Sample Input:
HTMLtoText ( "</h2>
<h2>Product Description:</h2>
Over 50 Conversions Very Quick<br /> Copy With click of 1 button<h2>What's new in this version:</h2>" ; "single" )
Sample Output:
<h2>Product Description:</h2>Over 50 Conversions Very Quick
Copy With click of 1 button<h2>What's new in this version:</h2>


 Then copy & paste into FileMaker Advanced's Edit Custom Function window.

Click here to copy To Clip Manager if you have myFMbutler's Clip Manager installed

Description:

Together with two subordinate custom functions "HTMLtoText_deleteTags" and "HTMLtoText_convertStyle" (also found on this site) this function will parseHTML text to plain text with preservation of any italic or bold markup in the HTML text. Several pages of text may be converted with reasonable text formating. The HTML text could be imported in a field by Troi URL plug-in, Fusion TCPdirect plug-in or by FileMaker GetLayoutObjectAttribute ( "WebViewerName" ; "content" ).

The second parameter (returns) controls if no empty lines should be allowed ( returns = "single") or one empty line may be allowed between paragraphs (returns = "double") with "double" as default.

Note: Requires FileMaker 10 or higher - unless 3 special char-values are stored in global fields.

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

This is my Custom Function and I want to edit it

Discuss:

5 most recent comments | Show all 10 comments

Hello,

i would like to have to output of the field into DB readable format like

"field1-1.row", "field2-1.row", "field3-1.row"
"field1-2.row", "field2-2.row", "field3-2.row"

any ideas?

Peter, Internet
June 10, 2014 5:00am

I've copied and pasted all three functions so I think they're accurate but the function is converting both <i> and <b> tags to bold.

I'm seriously impressed with the rest, though!

Any ideas what I might have done wrong?

Thanks.

Alastair, Edinburgh
February 10, 2015 7:44am

I answered my own question by adding a parameter, StyleToAdd to the HTMLtoText_convertStyle function and then using the parameter instead of 'Bold' in the second bottom line.

Then I added either 'Bold' or 'Italic' (without apostrophes) to the relevant lines of this function.

Thanks again.

Alastair, Edinburgh
February 10, 2015 7:54am

Very helpful custom function - have been using it for a few years. Getting one unexpected result; any ideas?

This HTML:

From: <b class="gmail_sendername">John Doe</b> <span dir="ltr">&lt;<a href="mailto:jdoe@acme.com">jdoe@acme.com</a>&gt;


Displays in a browser as:
From: John Doe <jdoe@acme.com>

But the custom function seems to delete the space and the less than symbol that proceeds the email address giving this result:

From: John Doejdoe@acme.com>

Holly Headhunter, Nashville TN
September 23, 2016 7:35am

Really really marvelous. Thanks a lot !!! I added some special characters like "&mdash" or &rsquo; for example, that are not converted. Very nice result.

Tigrou83, France
August 27, 2017 6:24am

Make a comment about this Custom Function (please try to keep it brief & to the point). Anyone can post:

Your Name:
City/Location:
Comment:
characters left. If you paste in more than 1500 characters, it will be truncated. Discuss the function - advertisements and other useless posts will be deleted.
Answer 7 + 9 =
Search for Custom Functions:

Custom Functions Widget
Download the Custom Function Dashboard Widget for OS X
Keep all the latest Custom Functions right at your fingertips!

Newest Custom Functions:

1. decFromHex ( hexValue )
  (Mon, Oct 16, 12:34pm)
2. MonthYearList ( startmonth ; startyear ; numbermonth ; short )
  (Mon, Oct 16, 3:38am)
3. ErrorDescription ( errorNumber )
  (Wed, Sep 27, 2:51am)
4. decodeEntities (text)
  (Wed, Sep 27, 1:22am)
5. HexidecimalToNumber ( HexidecimalValue ; counter )
  (Mon, Sep 25, 12:39pm)
6. FixedFieldConverter ( Fieldname ; f1 ; f2 ; f3 ; f4 ; f5 ; f6 ; f7 ; f8 ; f9 ; f10 ; f11 ; f12 ; f13 ; f14 ; f15 ; f16 ; f17 ; f18 ; f1
  (Fri, Sep 15, 12:34pm)
7. ShannonEntropy ( text )
  (Thu, Sep 07, 5:59am)
8. LetterCount ( text ; summary )
  (Thu, Sep 07, 5:53am)

RSS Feed of Custom Functions