Mercurial > repos > bgruening > sed_wrapper
comparison sed.xml @ 0:8ae62a63e93d draft default tip
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sed commit cfb00484086246d51865572f004e3140b8bf4852
| author | bgruening |
|---|---|
| date | Wed, 09 Nov 2016 14:50:45 -0500 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:8ae62a63e93d |
|---|---|
| 1 <tool id="sed_stream_editor" name="Manipulation" version="0.0.1"> | |
| 2 <description>utility that parses and transforms text using regular expressions (sed)</description> | |
| 3 <command> | |
| 4 <![CDATA[ | |
| 5 sed -r '$pattern' | |
| 6 $input > $outfile | |
| 7 ]]> | |
| 8 </command> | |
| 9 <inputs> | |
| 10 <param format="txt, tabular" name="input" type="data" label="Replace lines from"/> | |
| 11 <param name="pattern" type="text" value="" label="the pattern" help="here you can enter your sed expression (No syntax check or sanitising!)" /> | |
| 12 </inputs> | |
| 13 <outputs> | |
| 14 <data format="input" name="outfile" metadata_source="input"/> | |
| 15 </outputs> | |
| 16 <options sanitize="False"/> | |
| 17 <requirements> | |
| 18 <requirement type="binary">sed</requirement> | |
| 19 </requirements> | |
| 20 <tests> | |
| 21 | |
| 22 </tests> | |
| 23 <help> | |
| 24 <![CDATA[ | |
| 25 | |
| 26 .. class:: warningmark | |
| 27 | |
| 28 Use with caution! Its a plain wrapper around **sed** and the input is not sanitized. | |
| 29 | |
| 30 | |
| 31 ----- | |
| 32 | |
| 33 **What it does** | |
| 34 | |
| 35 Changes every line of a text file according to a given regular expression. | |
| 36 | |
| 37 ----- | |
| 38 | |
| 39 **Syntax** | |
| 40 | |
| 41 Use the **sed**-syntax -> **s/find-pattern/replace-pattern/** | |
| 42 | |
| 43 **Example** | |
| 44 | |
| 45 - **s/x/-/** Replace all **x** with **-**. | |
| 46 | |
| 47 - **s/_.*//** Splits a string after **_** and replaces the rest with nothing. | |
| 48 - **s/[^_]*_*//** Splits a string after **_** and replaces the first part with nothing. | |
| 49 | |
| 50 - **s/\\s.*//** Splits a string after whitespaces and replaces the rest with nothing. | |
| 51 - **s/\\S*\\s*//** Splits a string after whitespaces and replaces the first part with nothing. | |
| 52 | |
| 53 | |
| 54 ]]> | |
| 55 </help> | |
| 56 </tool> |
