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

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

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -