Index: trunk/ippTools/src/pxtools.c
===================================================================
--- trunk/ippTools/src/pxtools.c	(revision 23123)
+++ trunk/ippTools/src/pxtools.c	(revision 23873)
@@ -50,2 +50,27 @@
 // 'scrubbed' is a virtual state equivalent to cleaned, but allows files to be removed
 // even if the config files is missing
+
+
+// change the value for tableName.columName from 'full' to 'cleaned' if necessary
+bool pxSetStateCleaned(const psString tableName, const psString columnName, psArray *rows)
+{
+    for (long i = 0; i < psArrayLength(rows); i++) {
+        psMetadata *row = rows->data[i];
+        psString state = psMetadataLookupStr(NULL, row, columnName);
+        if (!state) {
+            psError(PS_ERR_PROGRAMMING, false, "%s not found in row %" PRId64 " of table %s",
+                columnName, i, tableName);
+            return false;
+        }
+        if (!strcmp("full", state)) {
+            // change full to cleaned
+            psMetadataAddStr(row, PS_LIST_TAIL, columnName, PS_META_REPLACE, "", "cleaned");
+        } else if (strcmp("cleaned", state)) {
+            // if state isn't cleaned or full we can't set it to cleaned
+            psError(PS_ERR_PROGRAMMING, true, "%s with state %s may not be exported cleaned",
+                tableName, state);
+            return false;
+        }
+    }
+    return true;
+}
