diff query_tabular.py @ 18:b9f797bf4f38 draft

Uploaded
author jjohnson
date Wed, 05 Jul 2017 11:51:15 -0400
parents 5b4f6cf857cf
children ab27c4bd14b9
line wrap: on
line diff
--- a/query_tabular.py	Thu Jun 22 09:15:36 2017 -0400
+++ b/query_tabular.py	Wed Jul 05 11:51:15 2017 -0400
@@ -91,6 +91,12 @@
             self.func = lambda i,l: '%d\t%s' % (i,l) 
         elif filter_dict['filter'] == 'append_line_num':
             self.func = lambda i,l: '%s\t%d' % (l.rstrip('\r\n'),i) 
+        elif filter_dict['filter'] == 'prepend_text':
+            s = filter_dict['column_text']
+            self.func = lambda i,l: '%s\t%s' % (s,l) 
+        elif filter_dict['filter'] == 'append_text':
+            s = filter_dict['column_text']
+            self.func = lambda i,l: '%s\t%s' % (l.rstrip('\r\n'),s) 
         elif filter_dict['filter'] == 'skip':
             cnt = filter_dict['count']
             self.func = lambda i,l: l if i > cnt else None