doing fread('zcat filePath.gz') still works

loadTableFromCsvFile <- function(csvFileName, verbose=FALSE, ...){
        #add zcat if the file extention is gz
        input <- paste0(ifelse(str_sub(csvFileName,-2)=='gz','zcat
',''),csvFileName) 
        #read the file
        dt <- fread(input,...)
        if(verbose) cat('Loaded',csvFileName,'\n')
        return(dt)
}




--
View this message in context: 
http://r.789695.n4.nabble.com/does-fread-read-gz-files-yet-tp4705980p4705992.html
Sent from the datatable-help mailing list archive at Nabble.com.
_______________________________________________
datatable-help mailing list
[email protected]
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help

Reply via email to