I am trying to return a file name from list.files, but there are 2 similarly named files.
filename.csv
filename_review.csv
I want to put each file name into its own list. Doing that for filename_review.csv
is easy since it has unique stuff in it, but how do I sift out the other? I need to grep(".csv", list.files())
without getting filename_review.csv
returned.
Showing all files in the working directory that has a csv extension but not ends in review could be done:
setdiff(list.files(pattern='.csv$'), list.files(pattern='review.csv$'))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With