Jump to content

the Otter

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

Recommended Posts

Okay… here’s a toughy. I’ve got a corrupt file, so we need to get all the data into a clone of a known-good backup. Obviously I can import it directly, but to be absolutely certain we’re getting rid of all corruption, my supervisor has requested that I export the data to merge files and then re-import it into the known-good clone, which sounds great to me. Unfortunately, there’s a snag: a lot of the data includes formatted text, which is very important to maintain. So, here’s the solution I came up with, repeated for each table in the solution:


1) Export all modification information (mod account, mod timestamp, etc.) to a merge file.


2) Loop through each field of each record of the current table and check for formatted text, using the following calculation:

GetAsCSS ( GetField ( $FieldName ) ) ≠
GetAsCSS ( TextFormatRemove ( GetField ( $FieldName ) ) )
Any data that returns True is replaced with its CSS equivalent.
3) Export the data to a second merge file.
4) Import the data from the second merge file into the backup.
5) Perform step 2 in reverse, using a slightly modified version of Christopher Gauntt’s CSStoFMText custom function.
6) Import the modification info from the first merge file into the backup.
I’ve gotten the script to the point where it’s working perfectly, but it’s taking forever: it’s been running step 2 on a particular table (62 fields, 2.3 million records) for over 12 hours and is still only about 60% complete. Once it’s done, it still has to run the remaining four steps on that table (I expect step 5 to take as long), then process the remaining 33 tables (most of which are smaller, but still).
Any thoughts on what I can do to optimize this further? Perhaps some method of finding formatted text?
Link to comment
Share on other sites

This topic is 2908 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.