annotate tools/unix_tools/cut_tool.xml @ 1:cdcb0ce84a1b

Uploaded
author xuebing
date Fri, 09 Mar 2012 19:45:15 -0500
parents 9071e359b9a3
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
1 <tool id="cshl_cut_tool" name="cut">
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
2 <description>columns from files</description>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
3 <command interpreter="sh">
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
4 cut_wrapper.sh '$complement' '$cutwhat' '$list' '$input' '$output'
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
5 </command>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
6
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
7 <inputs>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
8 <param format="txt" name="input" type="data" label="file to cut" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
9
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
10 <param name="complement" type="select" label="Operation">
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
11 <option value="">Keep</option>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
12 <option value="--complement">Discard</option>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
13 </param>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
14
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
15 <param name="cutwhat" type="select" label="Cut by">
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
16 <option value="-f">fields</option>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
17 <option value="-c">characters</option>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
18 </param>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
19
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
20 <param name="list" type="text" size="20" label="List of Fields/Characters/Bytes" help="These will be kept/discarded (depending on 'operation'). &lt;BR /&gt; Examples: 1,3,4 or 2-5" value = "" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
21 </inputs>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
22
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
23 <tests>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
24 <test>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
25 <param name="input" value="unix_cut_input1.txt" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
26 <output name="output" file="unix_cut_output1.txt" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
27 <param name="complement" value="Keep" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
28 <param name="cutwhat" value="fields" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
29 <param name="list" value="1,3,4" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
30 </test>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
31 <test>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
32 <param name="input" value="unix_cut_input1.txt" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
33 <output name="output" file="unix_cut_output1.txt" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
34 <param name="complement" value="Discard" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
35 <param name="cutwhat" value="fields" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
36 <param name="list" value="2" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
37 </test>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
38 </tests>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
39
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
40 <outputs>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
41 <data format="input" name="output" metadata_source="input"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
42 </outputs>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
43 <help>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
44
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
45 **What it does**
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
46
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
47 This tool runs the **cut** unix command, which extract or delete columns from a file.
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
48
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
49 -----
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
50
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
51 Field List Example:
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
52
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
53 **1,3,7** - Cut specific fields/characters.
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
54
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
55 **3-** - Cut from the third field/character to the end of the line.
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
56
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
57 **2-5** - Cut from the second to the fifth field/character.
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
58
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
59 **-8** - Cut from the first to the eight field/characters.
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
60
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
61
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
62
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
63
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
64 Input Example::
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
65
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
66 fruit color price weight
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
67 apple red 1.4 0.5
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
68 orange orange 1.5 0.3
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
69 banana yellow 0.9 0.3
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
70
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
71
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
72 Output Example ( **Keeping fields 1,3,4** )::
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
73
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
74 fruit price weight
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
75 apple 1.4 0.5
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
76 orange 1.5 0.3
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
77 banana 0.9 0.3
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
78
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
79 Output Example ( **Discarding field 2** )::
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
80
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
81 fruit price weight
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
82 apple 1.4 0.5
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
83 orange 1.5 0.3
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
84 banana 0.9 0.3
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
85
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
86 Output Example ( **Keeping 3 characters** )::
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
87
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
88 fru
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
89 app
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
90 ora
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
91 ban
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
92
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
93 </help>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
94 </tool>