Index: /trunk/Ohana/src/opihi/cmd.data/queuepop.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/queuepop.c	(revision 8189)
+++ /trunk/Ohana/src/opihi/cmd.data/queuepop.c	(revision 8190)
@@ -3,5 +3,6 @@
 int queuepop (int argc, char **argv) {
   
-  int N, Key;
+  int N;
+  char *Key;
   char *var;
   char *line;
@@ -16,8 +17,8 @@
   }
 
-  Key = -1;
+  Key = NULL;
   if ((N = get_argument (argc, argv, "-key"))) {
     remove_argument (N, &argc, argv);
-    Key = atoi (argv[N]);
+    Key = strcreate (argv[N]);
     remove_argument (N, &argc, argv);
     Value = strcreate (argv[N]);
@@ -38,18 +39,18 @@
   }
 
-  if (Key == -1) {
-      line = PopQueue (queue);
+  if (Key == NULL) {
+    line = PopQueue (queue);
   } else {
-      line = PopQueueMatch (queue, Key, Value);
+    line = PopQueueMatch (queue, Key, Value);
   }
 
   if (var == NULL) {
-      if (line == NULL) {
-	  gprint (GP_ERR, "queue %s is empty or match not found\n", argv[1]);
-	  return (FALSE);
-      } else {
-	  gprint (GP_ERR, "%s\n", line);
-	  return (TRUE);
-      }
+    if (line == NULL) {
+      gprint (GP_ERR, "queue %s is empty or match not found\n", argv[1]);
+      return (FALSE);
+    } else {
+      gprint (GP_ERR, "%s\n", line);
+      return (TRUE);
+    }
   }
 
@@ -61,4 +62,6 @@
 
   free (line);
+  if (Key != NULL) free (Key);
+
   return (TRUE);
 }
Index: /trunk/Ohana/src/opihi/cmd.data/queuepush.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/queuepush.c	(revision 8189)
+++ /trunk/Ohana/src/opihi/cmd.data/queuepush.c	(revision 8190)
@@ -3,5 +3,6 @@
 int queuepush (int argc, char **argv) {
   
-  int N, Unique, Replace, Key;
+  char *Key;
+  int N, Unique, Replace;
   Queue *queue;
 
@@ -18,8 +19,8 @@
   }
 
-  Key = -1;
+  Key = NULL;
   if ((N = get_argument (argc, argv, "-key"))) {
     remove_argument (N, &argc, argv);
-    Key = atoi (argv[N]);
+    Key = strcreate (argv[N]);
     remove_argument (N, &argc, argv);
   }
@@ -42,4 +43,6 @@
     PushQueue (queue, argv[2]);
   }
+
+  if (Key != NULL) free (Key);
   return (TRUE);
 }
Index: /trunk/Ohana/src/opihi/doc/pantasks.txt
===================================================================
--- /trunk/Ohana/src/opihi/doc/pantasks.txt	(revision 8189)
+++ /trunk/Ohana/src/opihi/doc/pantasks.txt	(revision 8190)
@@ -1,2 +1,8 @@
+
+- updates for queues:
+
+  -key 1:2:4 (key is string with possibly multiple columns joined)
+  string function to drop first word
+
 
 - todo:
Index: /trunk/Ohana/src/opihi/include/data.h
===================================================================
--- /trunk/Ohana/src/opihi/include/data.h	(revision 8189)
+++ /trunk/Ohana/src/opihi/include/data.h	(revision 8190)
@@ -26,7 +26,7 @@
 void PushNamedQueue (char *name, char *line);
 char *PopQueue (Queue *queue);
-char *PopQueueMatch (Queue *queue, int Key, char *value);
-void PushQueueUnique (Queue *queue, char *line, int Key);
-void PushQueueReplace (Queue *queue, char *line, int Key);
+char *PopQueueMatch (Queue *queue, char *Key, char *value);
+void PushQueueUnique (Queue *queue, char *line, char *Key);
+void PushQueueReplace (Queue *queue, char *line, char *Key);
 int InitQueue (Queue *queue);
 int DeleteQueue (Queue *queue);
Index: /trunk/Ohana/src/opihi/lib.data/queues.c
===================================================================
--- /trunk/Ohana/src/opihi/lib.data/queues.c	(revision 8189)
+++ /trunk/Ohana/src/opihi/lib.data/queues.c	(revision 8190)
@@ -141,5 +141,5 @@
 }
 
-char *ChooseKey (char *line, int Key) {
+char *ChooseSingleKey (char *line, int Key) {
 
   int i;
@@ -147,16 +147,53 @@
 
   key = line;
-  if (Key != -1) {
-    for (i = 0; (i < Key) && (key != NULL); i++) {
-      p = nextword (key);
-      key = p;
+  if (Key == -1) return line;
+
+  for (i = 0; (i < Key) && (key != NULL); i++) {
+    p = nextword (key);
+    key = p;
+  }
+  key = thisword (key);
+  return (key);
+}
+
+/* construct merged key given keylist of the form K:N:M */ 
+char *ChooseKey (char *line, char *keylist) {
+
+  char *output, *entry, *key, *p, *q;
+  int first, keynum;
+
+  if (line == NULL) return (NULL);
+  if (keylist == NULL) return (line);
+
+  ALLOCATE (output, char, strlen(line) + 1);
+  memset (output, 0, strlen(line) + 1);
+
+  first = TRUE;
+  p = q = keylist;
+  while (q != NULL) {
+    q = strchr (p, ':');
+    if (q == NULL) {
+      entry = strcreate (p);
+    } else {
+      entry = strncreate (p, q - p);
     }
-    key = thisword (key);
-  } 
-  return (key);
+    keynum = atoi (entry);
+    free (entry);
+
+    key = ChooseSingleKey (line, keynum);
+
+    if (!first) strcat (output, ":");
+    strcat (output, key);
+    free (key);
+
+    if (q != NULL) p = q + 1;
+    first = FALSE;
+  }
+
+  return (output);
 }
 
 /* push line onto queue, skipping existing matches (optionally by key) */
-void PushQueueUnique (Queue *queue, char *line, int Key) {
+void PushQueueUnique (Queue *queue, char *line, char *Key) {
 
   int i, j, N, found;
@@ -213,5 +250,5 @@
 
 /* push line onto queue, replacing matches (optionally by Key) */
-void PushQueueReplace (Queue *queue, char *line, int Key) {
+void PushQueueReplace (Queue *queue, char *line, char *Key) {
 
   int i, j, N, found;
@@ -291,5 +328,5 @@
 
 /* pop the first entry which for which the key matches */
-char *PopQueueMatch (Queue *queue, int Key, char *value) {
+char *PopQueueMatch (Queue *queue, char *Key, char *value) {
 
   int i, choice, NLINES_2;
