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

Popular posts from this blog

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - Chrome Extension: Interacting with iframe embedded within popup -