Mercurial > repos > mnhn65mo > csv_to_tabular
comparison csv2tab.R @ 0:b735ac78702b draft default tip
Uploaded
author | mnhn65mo |
---|---|
date | Wed, 08 Aug 2018 06:19:35 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:b735ac78702b |
---|---|
1 #!/usr/bin/env Rscript | |
2 #Read csv - return tabular | |
3 #2 Options for now : sep an header | |
4 | |
5 args = commandArgs(trailingOnly=TRUE) | |
6 | |
7 if(args[3]=="TRUE"){ | |
8 csv<-read.csv(args[1],sep=args[2],header=TRUE) | |
9 write.table(csv,"out.tabular",sep="\t",row.names=FALSE) | |
10 }else{ | |
11 csv<-read.csv(args[1],sep=args[2],header=FALSE) | |
12 write.table(csv,"out.tabular",sep="\t",col.names=FALSE,row.names=FALSE) | |
13 } | |
14 |