Set delimiter for rxImport

555 views Asked by At

I am currently trying to use the rxImport:

library(RevoScaleR)
dataDir<-"D:/NYSE/"
mycsv <- file.path(dataDir, "TAQ_TNQ_OPR_DER_ALL_01M_20130403_01.txt")
output<-file.path(dataDir, "data.xdf")
rxImport(inData = mycsv, outFile = output, overwrite = TRUE,)

However I need the delimiter on my file is set to '|'.

In standard file read in R:

data<-read.table(FILENAME, sep = "|", VERBOSE = TRUE,) 

I can set the delimiter. How do I do this with rxImport?

1

There are 1 answers

0
Andrie On BEST ANSWER

You define the characteristics of your text input file (i.e. csv) using RxTextData.

Try something like this:

input <- RxTextData("inputfile.csv", delimiter = "|")
rxImport(input, outfile = "mydata.xdf")