I'm trying to remove the white space in the filename that I have created using the follwing code:
epoch <- strsplit(toString(files[val]),split='.', fixed=TRUE)[[1]][1]
print(paste(epoch,".csv"))
The current output gives me: "2016_Q3 .csv"
. I would like to remove the whitespace between the 3
and the .
so the final string looks like "2016_Q3.csv"
I have looked at gsub
and trimws
, but can't get them to work.