Mercurial > repos > bgruening > text_processing
comparison tac.xml @ 4:56e80527c482 draft
Uploaded
author | bgruening |
---|---|
date | Wed, 07 Jan 2015 11:10:52 -0500 |
parents | |
children | 8928e6d1e7ba |
comparison
equal
deleted
inserted
replaced
3:7068d1548234 | 4:56e80527c482 |
---|---|
1 <tool id="tp_tac" name="tac" version="@BASE_VERSION@.0"> | |
2 <description>reverse a file (reverse cat)</description> | |
3 <macros> | |
4 <import>macros.xml</import> | |
5 </macros> | |
6 <expand macro="requirements" /> | |
7 <version_command>tac --version | head -n 1</version_command> | |
8 <command> | |
9 <![CDATA[ | |
10 tac | |
11 #if str($separator.separator_select) == "yes": | |
12 $separator.before | |
13 $separator.regex | |
14 $separator.separator_string | |
15 #end if | |
16 "$input" | |
17 > "$outfile" | |
18 ]]> | |
19 </command> | |
20 <inputs> | |
21 <param name="input" type="data" format="txt" label="Input file"/> | |
22 <conditional name="separator"> | |
23 <param name="separator_select" type="select" label="Do you want to use a separator other than newline?"> | |
24 <option value="yes">Yes</option> | |
25 <option value="no">No</option> | |
26 </param> | |
27 <when value="no" /> | |
28 <when value="yes"> | |
29 <param name="before" type="boolean" truevalue="-b" falsevalue="" checked="True" | |
30 label="Attach the separator before instead of after" help="(--before)"/> | |
31 <param name="regex" type="boolean" truevalue="-r" falsevalue="" checked="True" | |
32 label="Interpret the separator as a regular expression" help="(--regex)"/> | |
33 <param name="separator_string" size="5" type="text" value="" | |
34 label="Separator to use" help="(--separator)" /> | |
35 </when> | |
36 </conditional> | |
37 </inputs> | |
38 <outputs> | |
39 <data name="outfile" format="input" metadata_source="input"/> | |
40 </outputs> | |
41 <tests> | |
42 <test> | |
43 <param name="input" value="1.bed" ftype="txt"/> | |
44 <param name="before" value=""/> | |
45 <param name="regex" value=""/> | |
46 <output name="outfile" file="tac_result1.txt"/> | |
47 </test> | |
48 </tests> | |
49 <help> | |
50 <![CDATA[ | |
51 **What it does** | |
52 | |
53 tac is a Linux command that allows you to see a file line-by-line backwards. It is named by analogy with cat. | |
54 | |
55 Mandatory arguments to long options are mandatory for short options too: | |
56 | |
57 -b, --before attach the separator before instead of after | |
58 -r, --regex interpret the separator as a regular expression | |
59 -s, --separator=STRING use STRING as the separator instead of newline | |
60 | |
61 ----- | |
62 | |
63 **Example** | |
64 | |
65 Input file: | |
66 | |
67 0 1 2 3 4 5 # 6 7 8 9 | |
68 | |
69 | |
70 default settings: | |
71 | |
72 9 8 7 6 # 5 4 3 2 1 0 | |
73 | |
74 with option -s 5: | |
75 # 6 7 8 9 0 1 2 3 4 5 | |
76 | |
77 with option -b and -s 5: | |
78 | |
79 5 # 6 7 8 9 0 1 2 3 4 | |
80 | |
81 @REFERENCES@ | |
82 ]]> | |
83 </help> | |
84 </tool> |