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

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -

javascript - Using jquery append to add option values into a select element not working -

javascript - Restarting Supervisor and effect on FlaskSocketIO -