Index: trunk/ippToPsps/jython/stackbatch.py
===================================================================
--- trunk/ippToPsps/jython/stackbatch.py	(revision 39648)
+++ trunk/ippToPsps/jython/stackbatch.py	(revision 39649)
@@ -619,5 +619,5 @@
                 for name in self.tablesLoaded:
                     print "-- table: " + name
-                os._exit(3)
+                #os._exit(3)
                 continue
 
@@ -686,5 +686,5 @@
             for name in self.tablesLoaded:
                 print "-- table: " + name
-            os._exit(3)
+            #os._exit(3)
             return True
 
@@ -857,5 +857,5 @@
             for name in self.tablesLoaded:
                 print "-- table: " + name
-            os._exit(3)
+            #os._exit(3)
             return True
 
@@ -1158,10 +1158,37 @@
                 field = "INP_%04d" % input
                 inputName = self.getKeyValue(header, field)
-                
+                self.logger.infoPair("splitting",inputName)
                 # split inputName of form o5745g0406o.356782.wrp.1199763.skycell.1315.090.fits
                 # to get the expID (second block)
-                words = inputName.split('.')
-                frameID = words[1]
+#                worsds 
+                words2=re.sub(":",".",inputName)
+                words = words2.split('.')
+                #frameID = words[1]
                 
+                ogo = -1
+
+                # search the words for the o....g....o part
+                for j in range(len(words)):
+                    match = re.search('o\d\d\d\dg\d\d\d\d\o', words[j])
+                    if (match != None):
+                        ogo=j
+                        break
+                    # did we find it? if so, are there are least 2 more elements past the ogo?
+                    # this is to make sure that the exp_id is not truncated
+
+                if ogo > -1:
+                    if (ogo +1) < len(words):
+                        # there is a o....g....o element, and the next 2 exist
+                        frameID = words[ogo+1]
+                        
+                    else: 
+                        self.logger.infoPair("unable to find exp_id from", inputName)
+                        raise
+                        # and then raise an error and stop the program. I expect this to mostly work fine
+        # for the extra long label (?) - can probably get it from just the o g o (if exp_id
+        # is truncated, otherwise, there will have to be some extra cleverness with 
+        # queries and matching
+                self.logger.infoPair("found exp_id!", frameID)
+
                 field = "SCL_%04d" % input
                 scaleFactor = self.getKeyFloat(header, "%9.5f", field)
