diff macros.xml @ 9:a3aab6045663 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit daa9af57fe07ee83a45ddc9f855716f9d14a8e12"
author iuc
date Sat, 12 Sep 2020 01:22:05 +0000
parents 0c95a3f1654f
children 623f3eb7aa48
line wrap: on
line diff
--- a/macros.xml	Thu Jan 23 07:36:39 2020 -0500
+++ b/macros.xml	Sat Sep 12 01:22:05 2020 +0000
@@ -40,6 +40,9 @@
       #set $filter_dict['column'] = int(str($fi.filter.column).replace('c',''))
       #set $filter_dict['pattern'] = str($fi.filter.regex_pattern)
       #set $filter_dict['replace'] = str($fi.filter.regex_replace)
+      #if $fi.filter.add:
+          #set $filter_dict['add'] = str($fi.filter.add)
+      #end if
       #silent $input_filters.append($filter_dict)
     #elif str($fi.filter.filter_type).endswith('pend_line_num'):
       #set $filter_dict = dict()
@@ -172,7 +175,7 @@
                         <when value="replace">
                             <param name="column" type="text" value="" label="enter column number to replace"
                                 help="example: 1 or c1 (selects the first column)">
-                                <validator type="regex" message="Column ordinal position separated by commas">^(c?[1-9]\d*)$</validator>
+                                <validator type="regex" message="Column ordinal position">^(c?[1-9]\d*)$</validator>
                             </param>
                             <param name="regex_pattern" type="text" value="" label="regex pattern">
                                 <sanitizer sanitize="False"/>
@@ -180,6 +183,12 @@
                             <param name="regex_replace" type="text" value="" label="replacement expression">
                                 <sanitizer sanitize="False"/>
                             </param>
+                            <param name="add" type="select" optional="true" label="Instead of replacing, Add as new column:">
+                                <option value="prepend">prepend to beginning of row</option>
+                                <option value="append">append to the end of row</option>
+                                <option value="before">insert before column field</option>
+                                <option value="after">insert after column field</option>
+                            </param>
                         </when>
                         <when value="normalize">
                             <param name="columns" type="text" value="" label="enter column numbers to normalize">
@@ -211,6 +220,7 @@
   - by regex expression matching    *include/exclude* lines the match the regex expression 
   - select columns                  choose to include only selected columns in the order specified 
   - regex replace value in column   replace a field in a column using a regex substitution (good for date reformatting)
+  - regex replace value in column   add a new column using a regex substitution of a column value
   - prepend a line number column    each line has the ordinal value of the line read by this filter as the first column
   - append a line number column     each line has the ordinal value of the line read by this filter as the last column
   - prepend a text column           each line has the text string as the first column