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

Popular posts from this blog

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - Chrome Extension: Interacting with iframe embedded within popup -