Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 5215 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I can't figure this out but I'm guessing it should be easy some.

I have a database that already has a text entry field with many lines of data.

Let's call that field "DataEntry1".

I have new text entry field on the layout that is blank.

Let's call that field "DataEntry2"

I would like to create a script that will leave the first 10 lines of data as-is for "DataEntry1", and cut/paste all the rest of the text data/lines into the new field "DataEntry2".

This would be a loop for the entire database.

(It's fine if the "DataEntry2" field runs more than 10 lines or even an unlimited amount of lines.)

I was thinking maybe PatternCount(DataEntry1, "¦") >= 10 to see how many carriage returns were found, but I'm a bit stumped here on what sounds like an easy task.

Any help is greatly appreciated. Thanks.

Posted

Try this on a copy of your DB ( the replace step isn't undoable )

Show All Records

Replace Field Contents [ No dialog; YourTable::DataEntry2 ; [color:red]***Replace with calculated result:***

Let(

text = MiddleValues ( YourTable::DataEntry1 ; 11 ; ValueCount ( YourTable::DataEntry1 ) ) ;

Left ( text ; Length ( text ) - 1 )// This eliminates the extra ¶ added by the function MiddleValues ( )

)

]

Replace Field Contents [ No dialog; YourTable::DataEntry1 ; [color:red]***Replace with calculated result:***

Let(

text = MiddleValues ( YourTable::DataEntry1 ; 1 ; 10 ) ;

Left ( text ; Length ( text ) - 1 )// This eliminates the extra ¶ added by the function MiddleValues ( )

)

]

Commit Records/Requests [ ]

Posted

raybaudi, I really want to thank you for this help!

This worked perfectly on the first try!

Thank you so much!

This topic is 5215 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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