I'm not sure if I understand you correctly but if those are file names, you could do something like this
original_names <- list.files(pattern="_CAD")
new_names <- paste0(str_extract(original_names, "^.+?_"),
str_extract(original_names, "id.+(?=_CAD)"))
file.rename(original_names, new_names)