Delete empty csv files in directory - R -
have many csv files in folder (1.csv,2.csv....,20.csv) few of them empty (5.csv,8.csv). empty files contain size around 4 bytes , not size 0.
need delete them in directory , want achieve in r. possible? appreciate help!
the function countlines()
r.utils
package job:
library(r.utils) lapply(filter(function(x) countlines(x)==0, list.files(pattern='.csv')), unlink)
Comments
Post a Comment