How can I use R to remove a file extension that is not alphanumeric extension -
this example of file name
mod09a1.a2000049.h19v11.005.2006268194400.hdf.sur_refl_day_of_year initially
mod09a1.a2000049.h19v11.005.2006268194400.hdf.sur_refl_day_of_year.tif i used function file_path_sans_ext remove ".tiff" still want remove ".sur_refl_day_of_year". need file name mod09a1.a2000049.h19v11.005.2006268194400.hdf only.
try:
sub("(\\.hdf).*", "\\1", myfilename)
Comments
Post a Comment