If you want to feel powerful in R, use pivot_* with names_pattern and a pretty simple regex like (u?wd_?.*)_([[2][0-1])_(.*)$.