0
|
1 <tool id="csv2tab_R" name="CSV to Tabular" version="0.1">
|
|
2 <requirements>
|
|
3 <requirement type="package" version="3.2.1">R</requirement>
|
|
4 </requirements>
|
|
5 <command detect_errors="exit_code"><![CDATA[
|
|
6 Rscript '$__tool_directory__/csv2tab.R' '$input1' '$sep' '$header' '$output' ]]>
|
|
7 </command>
|
|
8 <inputs>
|
|
9 <param format="csv" name="input1" type="data" label="CSV file"/>
|
|
10 <param name="sep" type="text" label="Separator" value=",">
|
|
11 <sanitizer sanitize="False"/>
|
|
12 </param>
|
|
13 <param name="header" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="true" label="Header in file"/>
|
|
14
|
|
15 </inputs>
|
|
16
|
|
17 <outputs>
|
|
18 <data format="tabular" name="output" from_work_dir="out.tabular" />
|
|
19 </outputs>
|
|
20
|
|
21 <tests>
|
|
22 <test>
|
|
23 <param name="input1" value="example_csv.csv"/>
|
|
24 <param name="sep" value=","/>
|
|
25 <param name="header" value="FALSE"/>
|
|
26 <output name="output" file="out.tabular"/>
|
|
27 </test>
|
|
28 </tests>
|
|
29
|
|
30 <help>
|
|
31 **What it does**
|
|
32
|
|
33 Convert a CSV file to a tabular.
|
|
34
|
|
35 Transform the chosen separator to tab. It is important to specify if the file has a header line.
|
|
36
|
|
37 If the field separator is a comma and there are commas inside text fields the tool will only modify the first category in tabs.
|
|
38
|
|
39 ------
|
|
40
|
|
41 **Example**
|
|
42
|
|
43 Input CSV :
|
|
44
|
|
45 "John","Smith","2 mySteet, myCity"
|
|
46
|
|
47 "François","LeFrançais","1 rue du Général, Paris"
|
|
48
|
|
49 "Other","Random","Stuff, stuff, stuff"
|
|
50
|
|
51
|
|
52
|
|
53 Output tabular :
|
|
54
|
|
55 "John" "Smith" "2 mySteet, myCity"
|
|
56
|
|
57 "François" "LeFrançais" "1 rue du Général, Paris"
|
|
58
|
|
59 "Other" "Random" "Stuff, stuff, stuff"
|
|
60
|
|
61 ------
|
|
62
|
|
63 **Arguments**
|
|
64
|
|
65 Input : csv file.
|
|
66
|
|
67 Separator : default is ",".
|
|
68
|
|
69 Header : True/False.
|
|
70
|
|
71
|
|
72 </help>
|
|
73 </tool>
|