Mercurial > repos > bgruening > text_processing
comparison sed.xml @ 4:56e80527c482 draft
Uploaded
author | bgruening |
---|---|
date | Wed, 07 Jan 2015 11:10:52 -0500 |
parents | 7068d1548234 |
children | 8928e6d1e7ba |
comparison
equal
deleted
inserted
replaced
3:7068d1548234 | 4:56e80527c482 |
---|---|
1 <tool id="tp_sed_tool" name="Text transformation" version="0.1.1"> | 1 <tool id="tp_sed_tool" name="Text transformation" version="@BASE_VERSION@.0"> |
2 <description>with sed</description> | 2 <description>with sed</description> |
3 <requirements> | 3 <macros> |
4 <import>macros.xml</import> | |
5 </macros> | |
6 <expand macro="requirements"> | |
4 <requirement type="package" version="4.2.2-sandbox">gnu_sed</requirement> | 7 <requirement type="package" version="4.2.2-sandbox">gnu_sed</requirement> |
5 </requirements> | 8 </expand> |
9 <version_command>sed --version | head -n 1</version_command> | |
6 <command> | 10 <command> |
7 sed --sandbox -r | 11 <![CDATA[ |
8 | 12 sed |
9 #if $adv_opts.adv_opts_selector == 'advanced': | 13 --sandbox |
10 $adv_opts.silent | 14 -r |
11 #end if | 15 #if $adv_opts.adv_opts_selector == 'advanced': |
12 -f '$sed_script' '$input' > '$output' | 16 $adv_opts.silent |
17 #end if | |
18 -f '$sed_script' | |
19 '$infile' | |
20 > '$output' | |
21 ]]> | |
13 </command> | 22 </command> |
14 <inputs> | 23 <inputs> |
15 <param format="txt" name="input" type="data" label="File to process" /> | 24 <param format="txt" name="infile" type="data" label="File to process" /> |
16 | |
17 <param name="url_paste" type="text" area="true" size="5x35" label="SED Program" help=""> | 25 <param name="url_paste" type="text" area="true" size="5x35" label="SED Program" help=""> |
18 <sanitizer> | 26 <sanitizer> |
19 <valid initial="string.printable"> | 27 <valid initial="string.printable"> |
20 <remove value="'"/> | 28 <remove value="'"/> |
21 </valid> | 29 </valid> |
22 </sanitizer> | 30 </sanitizer> |
23 </param> | 31 </param> |
24 | |
25 <conditional name="adv_opts"> | 32 <conditional name="adv_opts"> |
26 <param name="adv_opts_selector" type="select" label="Advanced Options"> | 33 <param name="adv_opts_selector" type="select" label="Advanced Options"> |
27 <option value="basic" selected="True">Hide Advanced Options</option> | 34 <option value="basic" selected="True">Hide Advanced Options</option> |
28 <option value="advanced">Show Advanced Options</option> | 35 <option value="advanced">Show Advanced Options</option> |
29 </param> | 36 </param> |
33 <option value="">normal</option> | 40 <option value="">normal</option> |
34 <option value="-n">silent</option> | 41 <option value="-n">silent</option> |
35 </param> | 42 </param> |
36 </when> | 43 </when> |
37 </conditional> | 44 </conditional> |
38 | 45 </inputs> |
39 </inputs> | |
40 <configfiles> | 46 <configfiles> |
41 <configfile name="sed_script"> | 47 <configfile name="sed_script"> |
42 $url_paste | 48 $url_paste |
43 </configfile> | 49 </configfile> |
44 </configfiles> | 50 </configfiles> |
45 <tests> | 51 <outputs> |
46 <test> | 52 <data format="input" name="output" metadata_source="infile" /> |
47 <param name="input" value="unix_sed_input1.txt" /> | 53 </outputs> |
48 <output name="output" file="unix_sed_output1.txt" /> | 54 <tests> |
49 <param name="url_paste" value="1d ; s/foo/bar/" /> | 55 <test> |
50 <param name="silent" value="" /> | 56 <param name="infile" value="unix_sed_input1.txt" /> |
51 </test> | 57 <param name="url_paste" value="1d ; s/foo/bar/" /> |
52 <test> | 58 <param name="silent" value="" /> |
53 <param name="input" value="unix_sed_input1.txt" /> | 59 <output name="output" file="unix_sed_output1.txt" /> |
54 <output name="output" file="unix_sed_output2.txt" /> | 60 </test> |
55 <param name="url_paste" value="/foo/ { s/foo/baz/g ; p }" /> | 61 <test> |
56 <param name="silent" value="silent" /> | 62 <param name="infile" value="unix_sed_input1.txt" /> |
57 </test> | 63 <param name="url_paste" value="/foo/ { s/foo/baz/g ; p }" /> |
58 </tests> | 64 <param name="silent" value="silent" /> |
59 <outputs> | 65 <output name="output" file="unix_sed_output2.txt" /> |
60 <data format="input" name="output" metadata_source="input" /> | 66 </test> |
61 </outputs> | 67 </tests> |
62 <help> | 68 <help> |
63 | 69 <![CDATA[ |
64 **What it does** | 70 **What it does** |
65 | 71 |
66 This tool runs the unix **sed** command on the selected data file. | 72 This tool runs the unix **sed** command on the selected data file. |
67 | 73 |
68 .. class:: infomark | 74 .. class:: infomark |
118 - **\|** Separates alternate possibilities. | 124 - **\|** Separates alternate possibilities. |
119 | 125 |
120 | 126 |
121 **Note**: SED uses extended regular expression syntax, not Perl syntax. **\\d**, **\\w**, **\\s** etc. are **not** supported. | 127 **Note**: SED uses extended regular expression syntax, not Perl syntax. **\\d**, **\\w**, **\\s** etc. are **not** supported. |
122 | 128 |
129 @REFERENCES@ | |
130 ]]> | |
123 </help> | 131 </help> |
124 </tool> | 132 </tool> |