Mercurial > repos > bgruening > text_processing
diff tac.xml @ 0:5314e5d6f040 draft
Imported from capsule None
author | bgruening |
---|---|
date | Thu, 29 Jan 2015 07:53:17 -0500 |
parents | |
children | 37e1eb05b1b4 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tac.xml Thu Jan 29 07:53:17 2015 -0500 @@ -0,0 +1,90 @@ +<tool id="tp_tac" name="tac" version="@BASE_VERSION@.0"> + <description>reverse a file (reverse cat)</description> + <macros> + <import>macros.xml</import> + </macros> + <expand macro="requirements" /> + <version_command>tac --version | head -n 1</version_command> + <command> +<![CDATA[ + tac + #if str($separator.separator_select) == "yes": + $separator.before + $separator.regex + #if $separator.separator_string: + "$separator.separator_string" + #end if + #end if + "$infile" + > "$outfile" +]]> + </command> + <inputs> + <param name="infile" type="data" format="txt" label="Input file"/> + <conditional name="separator"> + <param name="separator_select" type="select" label="Do you want to use a separator other than newline?"> + <option value="no">No</option> + <option value="yes">Yes</option> + </param> + <when value="no" /> + <when value="yes"> + <param name="before" type="boolean" truevalue="-b" falsevalue="" checked="True" + label="Attach the separator before instead of after" help="(--before)"/> + <param name="regex" type="boolean" truevalue="-r" falsevalue="" checked="True" + label="Interpret the separator as a regular expression" help="(--regex)"/> + <param name="separator_string" size="5" type="text" value="" + label="Separator to use" help="(--separator)" /> + </when> + </conditional> + </inputs> + <outputs> + <data name="outfile" format_source="infile" metadata_source="infile"/> + </outputs> + <tests> + <test> + <param name="infile" value="1.bed"/> + <output name="outfile" file="tac_result1.txt"/> + </test> + <test> + <param name="infile" value="1.bed"/> + <param name="separator_select" value="yes"/> + <param name="before" value="True"/> + <output name="outfile" file="tac_result2.txt"/> + </test> + </tests> + <help> +<![CDATA[ +**What it does** + +tac is a Linux command that allows you to see a file line-by-line backwards. It is named by analogy with cat. + +Mandatory arguments to long options are mandatory for short options too: + + -b, --before attach the separator before instead of after + -r, --regex interpret the separator as a regular expression + -s, --separator=STRING use STRING as the separator instead of newline + +----- + +**Example** + +Input file: + + 0 1 2 3 4 5 # 6 7 8 9 + + +default settings: + + 9 8 7 6 # 5 4 3 2 1 0 + +with option -s 5: + # 6 7 8 9 0 1 2 3 4 5 + +with option -b and -s 5: + + 5 # 6 7 8 9 0 1 2 3 4 + +@REFERENCES@ +]]> + </help> +</tool>