August 14, 201015 yr 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.
August 14, 201015 yr 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 [ ]
August 14, 201015 yr Author raybaudi, I really want to thank you for this help! This worked perfectly on the first try! Thank you so much!
Create an account or sign in to comment