Mercurial > repos > bgruening > text_processing
diff sed.xml @ 6:8928e6d1e7ba draft
Uploaded
author | bgruening |
---|---|
date | Thu, 08 Jan 2015 09:07:31 -0500 |
parents | 56e80527c482 |
children | d64eace4f9f3 |
line wrap: on
line diff
--- a/sed.xml Wed Jan 07 11:15:41 2015 -0500 +++ b/sed.xml Thu Jan 08 09:07:31 2015 -0500 @@ -9,7 +9,7 @@ <version_command>sed --version | head -n 1</version_command> <command> <![CDATA[ - sed + sed --sandbox -r #if $adv_opts.adv_opts_selector == 'advanced': @@ -22,7 +22,7 @@ </command> <inputs> <param format="txt" name="infile" type="data" label="File to process" /> - <param name="url_paste" type="text" area="true" size="5x35" label="SED Program" help=""> + <param name="code" type="text" area="true" size="5x35" label="SED Program" help=""> <sanitizer> <valid initial="string.printable"> <remove value="'"/> @@ -36,7 +36,7 @@ </param> <when value="basic" /> <when value="advanced"> - <param name="silent" type="select" label="operation mode" help="(Same as 'sed -n', leave at 'normal' unless you know what you're doing)" > + <param name="silent" type="select" label="Operation mode" help="Same as 'sed -n', leave at 'normal' unless you know what you're doing." > <option value="">normal</option> <option value="-n">silent</option> </param> @@ -45,24 +45,25 @@ </inputs> <configfiles> <configfile name="sed_script"> - $url_paste + $code </configfile> </configfiles> <outputs> - <data format="input" name="output" metadata_source="infile" /> + <data name="output" format_source="infile" metadata_source="infile" /> </outputs> <tests> <test> - <param name="infile" value="unix_sed_input1.txt" /> - <param name="url_paste" value="1d ; s/foo/bar/" /> + <param name="infile" value="sed1.txt" /> + <param name="code" value="1d ; s/foo/bar/" /> <param name="silent" value="" /> - <output name="output" file="unix_sed_output1.txt" /> + <output name="output" file="sed_results1.txt" /> </test> <test> - <param name="infile" value="unix_sed_input1.txt" /> - <param name="url_paste" value="/foo/ { s/foo/baz/g ; p }" /> - <param name="silent" value="silent" /> - <output name="output" file="unix_sed_output2.txt" /> + <param name="infile" value="sed1.txt" /> + <param name="code" value="/foo/ { s/foo/baz/g ; p }" /> + <param name="adv_opts_selector" value="advanced" /> + <param name="silent" value="-n" /> + <output name="output" file="sed_results2.txt" /> </test> </tests> <help> @@ -95,8 +96,8 @@ - **s/hsa//** will remove the first instance of 'hsa' in every line. - **s/hsa//g** will remove all instances (beacuse of the **g**) of 'hsa' in every line. -- **s/A{4,}/--&--/g** will find sequences of 4 or more consecutive A's, and once found, will surround them with two dashes from each side. The **&** marker is a place holder for 'whatever matched the regular expression'. -- **s/hsa-mir-([^ ]+)/short name: \\1 full name: &/** will find strings such as 'hsa-mir-43a' (the regular expression is 'hsa-mir-' followed by non-space characters) and will replace it will string such as 'short name: 43a full name: hsa-mir-43a'. The **\\1** marker is a place holder for 'whatever matched the first parenthesis' (similar to perl's **$1**) . +- **s/A{4,}/--&--/g** will find sequences of 4 or more consecutive A's, and once found, will surround them with two dashes from each side. The **&** marker is a place holder for 'whatever matched the regular expression'. +- **s/hsa-mir-([^ ]+)/short name: \\1 full name: &/** will find strings such as 'hsa-mir-43a' (the regular expression is 'hsa-mir-' followed by non-space characters) and will replace it will string such as 'short name: 43a full name: hsa-mir-43a'. The **\\1** marker is a place holder for 'whatever matched the first parenthesis' (similar to perl's **$1**) . **sed's Regular Expression Syntax**