Mercurial > repos > mnhn65mo > tabular_to_csv
diff tab2csv.R @ 0:659820e2aa61 draft
Uploaded
author | mnhn65mo |
---|---|
date | Wed, 08 Aug 2018 06:23:04 -0400 |
parents | |
children | f1b7d0032530 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tab2csv.R Wed Aug 08 06:23:04 2018 -0400 @@ -0,0 +1,14 @@ +#!/usr/bin/env Rscript +#Read csv - return tabular +#2 Options for now : sep an header + +args = commandArgs(trailingOnly=TRUE) + +if(args[3]=="TRUE"){ + tabular<-read.table(args[1],sep="\t",header=TRUE) + write.tale(tabular,"out.csv",sep=args[2],row.names=FALSE) +}else{ + tabular<-read.table(args[1],sep="\t",header=FALSE) + write.table(tabular,"out.csv",sep=args[2],col.names=FALSE,row.names=FALSE) +} +