Mercurial > repos > gordon > unix_tools
comparison cut.xml @ 0:631dfde45073 draft default tip
First tool-shed public version
| author | gordon |
|---|---|
| date | Tue, 09 Oct 2012 18:48:06 -0400 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:631dfde45073 |
|---|---|
| 1 <tool id="cshl_cut_tool" name="cut" version="0.1.1"> | |
| 2 <description>columns from files</description> | |
| 3 <command> | |
| 4 cut $complement $cutwhat '$list' '$input1' > '$output' | |
| 5 </command> | |
| 6 | |
| 7 <inputs> | |
| 8 <param format="txt" name="input1" type="data" label="file to cut" /> | |
| 9 | |
| 10 <param name="complement" type="select" label="Operation"> | |
| 11 <option value="">Keep</option> | |
| 12 <option value="--complement">Discard</option> | |
| 13 </param> | |
| 14 | |
| 15 <param name="cutwhat" type="select" label="Cut by"> | |
| 16 <option value="-f">fields</option> | |
| 17 <option value="-c">characters</option> | |
| 18 <option value="-b">bytes</option> | |
| 19 </param> | |
| 20 | |
| 21 <param name="list" type="text" size="20" label="List of Fields/Characters/Bytes" help="These will be kept/discarded (depending on 'operation'). <BR /> Examples: 1,3,4 or 2-5" value = ""> | |
| 22 <sanitizer> | |
| 23 <valid initial="string.printable"> | |
| 24 <remove value="'"/> | |
| 25 </valid> | |
| 26 </sanitizer> | |
| 27 </param> | |
| 28 </inputs> | |
| 29 | |
| 30 <outputs> | |
| 31 <data format="input" name="output" metadata_source="input1" | |
| 32 /> | |
| 33 </outputs> | |
| 34 <help> | |
| 35 | |
| 36 **What it does** | |
| 37 | |
| 38 This tool runs the **cut** unix command, which extract or delete columns from a file. | |
| 39 | |
| 40 ----- | |
| 41 | |
| 42 Field List Example: | |
| 43 | |
| 44 **1,3,7** - Cut specific fields/characters. | |
| 45 | |
| 46 **3-** - Cut from the third field/character to the end of the line. | |
| 47 | |
| 48 **2-5** - Cut from the second to the fifth field/character. | |
| 49 | |
| 50 **-8** - Cut from the first to the eight field/characters. | |
| 51 | |
| 52 | |
| 53 | |
| 54 | |
| 55 Input Example:: | |
| 56 | |
| 57 fruit color price weight | |
| 58 apple red 1.4 0.5 | |
| 59 orange orange 1.5 0.3 | |
| 60 banana yellow 0.9 0.3 | |
| 61 | |
| 62 | |
| 63 Output Example ( **Keeping fields 1,3,4** ):: | |
| 64 | |
| 65 fruit price weight | |
| 66 apple 1.4 0.5 | |
| 67 orange 1.5 0.3 | |
| 68 banana 0.9 0.3 | |
| 69 | |
| 70 Output Example ( **Discarding field 2** ):: | |
| 71 | |
| 72 fruit price weight | |
| 73 apple 1.4 0.5 | |
| 74 orange 1.5 0.3 | |
| 75 banana 0.9 0.3 | |
| 76 | |
| 77 Output Example ( **Keeping 3 characters** ):: | |
| 78 | |
| 79 fru | |
| 80 app | |
| 81 ora | |
| 82 ban | |
| 83 | |
| 84 </help> | |
| 85 </tool> |
