Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Hello, i try to delete a paragraph or sentence if it contains a sting for example

Quote

The prologue of Romeo and Juliet calls the title characters “star-crossed lovers”

And the stars do seem to conspire against these young lovers

 

Romeo is a Montague, and Juliet a Capulet

Their families are enmeshed in a feud, but the moment they meet

when Romeo and his friends attend a party at Juliet’s house in disguise

he two fall in love and quickly decide that they want to be married

in this field i would like to delete all sentence containing string "romeo"  so the result should be : 

Quote

And the stars do seem to conspire against these young lovers

 

Their families are enmeshed in a feud, but the moment they meet

 

he two fall in love and quickly decide that they want to be married

Thanks you :) 

Edited by ibobo

44 minutes ago, ibobo said:

i try to delete a paragraph or sentence if it contains a sting

There is a big difference between a paragraph and a sentence. Filemaker knows what a paragraph is (technically, it's a value in a return-separated list), but it has no concept of a sentence.

To remove values containing a string, make your script loop over them and return only those that do not, for example:

Set Variable [ $text; Value:Table::Source ] 
Loop 
  Set Variable [ $i; Value:$i + 1 ] 
  Exit Loop If [ $i > ValueCount ( $text ) ] 
  Set Variable [ $para; Value:MiddleValues ( $text ; $i ; 1 ) ] 
  If [ not PatternCount ( $para ; "romeo" ) ] 
    Set Variable [ $result; Value:$result & $para ] 
  End If 
End Loop 
Set Field [ Table::Target; $result ] 

 

 

 

 

Edited by comment

  • Author

Thanks you a lot Comment ! 

it works perfectly B)

last think :angel: if i want add to Romeo many other strings like Juliet, Freud, ..?

3 minutes ago, ibobo said:

if i want add to Romeo many other strings like Juliet, Freud,

How many? And where do you want to keep them?

  • Author

a lot, like 100 -/+, and keep where it s the best ? 

maybe if i put them in a field with different table and PatternCount take it each and loop ?  

 

 

57 minutes ago, ibobo said:

maybe if i put them in a field with different table

That would seem most suitable. See the attached:

Loop2.fp7

  • Author

 thanks you ! it s work perfectly, like in my dream :baby:

  • Author

Hi Comment,

do you know  if i could add that the script that you made : delete also previous paragraph ? 

for exemple : 

Quote

And the stars do seem to conspire against these young lovers

 

Their families are enmeshed in a feud, but the moment they meet

he two fall in love and quickly decide that they want to be married 

if content "two" delete the same paragraph and the previous paragraph. like this : 

 

Quote

And the stars do seem to conspire against these young livers

 

(deleted because previous to "two"

(deleted because of content "two"

Thanks 

I believe it would be easier to discard a paragraph when it or the next paragraph contain the search string.

To do this, you can change the definition of the $match variable to =

PatternCount ( MiddleValues ( $text ; $i ; 2 ) ; GetValue ( $values ; $j ) )

 

 

 

 

  • Author

merci beaucoup ! works perfectly you are genius ! B)

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.