I have data frame that has a column with large number of file names like:
d <- c(\"harry11_scott80_norm.avi\",\"harry11_norm.avi\",\"harry11_scott80_lpf.
If your filenames are all of the same format, that is those with two names i.e harry11_scott80_norm.avi always have two underscores, and those with one name i.e. harry11_norm.avi always have one underscore, you can quickly use something like this to rename your files:
d = gsub(".*_.*_.*", "incongruent", d)
> d
[1] "incongruent" "harry11_norm.avi" "incongruent" "joel51_lpf.avi"
[5] "incongruent"
d =gsub(".*_.*","congruent",d)
> d
[1] "incongruent" "congruent" "incongruent" "congruent" "incongruent"