Mercurial > repos > bgruening > text_processing
view tac.xml @ 4:56e80527c482 draft
Uploaded
author | bgruening |
---|---|
date | Wed, 07 Jan 2015 11:10:52 -0500 |
parents | |
children | 8928e6d1e7ba |
line wrap: on
line source
<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 $separator.separator_string #end if "$input" > "$outfile" ]]> </command> <inputs> <param name="input" 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="yes">Yes</option> <option value="no">No</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="input" metadata_source="input"/> </outputs> <tests> <test> <param name="input" value="1.bed" ftype="txt"/> <param name="before" value=""/> <param name="regex" value=""/> <output name="outfile" file="tac_result1.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>