You could define an unstored calculation field that strips out returns and formatting, and then replace the original text field on your list layout with the new unstored calc field:
In your table that includes the text field, add a field called something like z_Text_Unformatted, defined as a calculation field, and use a formula like this:
Substitute( TextFormatRemove( Text_Field ) , “¶” , “ * “ ) /* replace carriage returns with asterisks */
Because this is a calculated field, users will not be able to modify the field in list view. But be sure to allow entry in both “Browse” and “Find” view, so users can click into the field to reveal text beyond what fits by default in the space you allot in list view.
Peace, love & brown rice,
FileMaker + Web: Design, Develop & Deploy
Certifications: FileMaker 9, 10 & 11
One Part Harmony
Austin, Texas • USA
Apply the formatting to the field instance, not to the content.
When in different records there has to be different formats, then try conditional formatting.
Always paste without format. You could replace the Paste menu item (Cmd-V / Ctrl-V) with a custom menu item, being Paste (without format).
You've got good answers:
Changing the Paste command (hbrendel's answer) will help with future pasted data.
The substitute function (Morgan's answer) will clean up new data as it's entered, and can be used in a Replace command for a one-time cleanup of existing data.
Also, removing the Format menu options via custom menus will keep people from atempting to add formats to data manually. Although a substitute function at the field definition level of a field-level script trigger will take care of this, it's wise not to let users try to impose formats manually if you are going to instantly strip it out. Users will think something's wrong otherwise when they use the Formatting menu and it doesn't work.
However, the formatting is retained when I go to table view which makes it difficult to read. Is there a way to make the formatting stay just with one particular view?
Are you simply switching views on same layout? The simple, and best, answer is to use two different layouts instead of just switching views. You will then have complete control over the formatting of the table layout, including alternating row colors. Table view does not support portals, stacked fields, tab panels, duplicate fields or script buttons in the body so a mode switch to table from form view can cause problems.