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

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 -