Help me regexp gurus please problem is matching files and copy
-
original folder "datasets to optimize" contains 1000s files like this variable 2-3 dots and 1 dot with numbers 1.87.184 and 0.35643634, and sometimes they contain (#num#) at the end of number how to copy matching files from "datasets to optimize" to "result"?
~/Documents/optimizer/datasets to optimize #
-rwxr-xr-x 1 root root 170K Nov 11 14:11 'MethodStats 1.87.184_vardata_L6_probin.txt'
-rwxr-xr-x 1 root root 193K Nov 11 14:11 'MethodStats 0.206117(4)_vardata_L6_probin.txt'
-rwxr-xr-x 1 root root 199K Nov 11 14:11 'MethodStats 9.58.155_vardata_L6_probin.txt'
-rwxr-xr-x 1 root root 187K Nov 11 14:11 'MethodStats 9.61.114_vardata_L6_probin.txt'
-rwxr-xr-x 1 root root 181K Nov 11 14:11 'MethodStats 9.6.185_vardata_L6_probin.txt'
-rwxr-xr-x 1 root root 212K Nov 11 14:11 'MethodStats 9.64.191_vardata_L6_probin.txt'
-rwxr-xr-x 1 root root 171K Nov 11 14:11 'MethodStats 9.66.150_vardata_L6_probin.txt'
-rwxr-xr-x 1 root root 231K Nov 11 14:11 'MethodStats 9.72.194_vardata_L6_probin.txt'
-rwxr-xr-x 1 root root 241K Nov 11 14:11 'MethodStats 9.73.138_vardata_L6_probin.txt'
-rwxr-xr-x 1 root root 176K Nov 11 14:11 'MethodStats 9.83.123_vardata_L6_probin.txt'
-rwxr-xr-x 1 root root 179K Nov 11 14:11 'MethodStats 9.83.125_vardata_L6_probin.txt'
-rwxr-xr-x 1 root root 181K Nov 11 14:11 'MethodStats 9.83.195_vardata_L6_probin.txt'
-rwxr-xr-x 1 root root 176K Nov 11 14:11 'MethodStats 9.85.133_vardata_L6_probin.txt'
-rwxr-xr-x 1 root root 218K Nov 11 14:11 'MethodStats 9.85.167_vardata_L6_probin.txt'
-rwxr-xr-x 1 root root 195K Nov 11 14:11 'MethodStats 9.86.177_vardata_L6_probin.txt'
-rwxr-xr-x 1 root root 178K Nov 11 14:11 'MethodStats 23.92.166(1)_vardata_L6_probin.txt'
-rwxr-xr-x 1 root root 210K Nov 11 14:11 'MethodStats 9.89.189_vardata_L6_probin.txt'
-rwxr-xr-x 1 root root 218K Nov 11 14:11 'MethodStats 0.2048140_vardata_L6_probin.txt'
and output folder "result" has the same but before that is added FW Retest
/root/Documents/optimizer/result
-rwxr-xr-x 1 root root 3.4M Nov 11 14:14 'FW Retest - MethodStats 1.87.184_vardata_L6_probin.txt'
-rwxr-xr-x 1 root root 2.7M Nov 11 14:15 'FW Retest - MethodStats 0.2048140_vardata_L6_probin.txt'
-rwxr-xr-x 1 root root 2.5M Nov 11 14:15 'FW Retest - MethodStats 0.206117(4)_vardata_L6_probin.txt'
-rwxr-xr-x 1 root root 2.4M Nov 11 14:15 'FW Retest - MethodStats 23.92.166(1)_vardata_L6_probin.txt'
how to copy matching files from "datasets to opt
-
original folder "datasets to optimize" contains 1000s files like this variable 2-3 dots and 1 dot with numbers 1.87.184 and 0.35643634, and sometimes they contain (#num#) at the end of number how to copy matching files from "datasets to optimize" to "result"?
~/Documents/optimizer/datasets to optimize #
-rwxr-xr-x 1 root root 170K Nov 11 14:11 'MethodStats 1.87.184_vardata_L6_probin.txt'
-rwxr-xr-x 1 root root 193K Nov 11 14:11 'MethodStats 0.206117(4)_vardata_L6_probin.txt'
-rwxr-xr-x 1 root root 199K Nov 11 14:11 'MethodStats 9.58.155_vardata_L6_probin.txt'
-rwxr-xr-x 1 root root 187K Nov 11 14:11 'MethodStats 9.61.114_vardata_L6_probin.txt'
-rwxr-xr-x 1 root root 181K Nov 11 14:11 'MethodStats 9.6.185_vardata_L6_probin.txt'
-rwxr-xr-x 1 root root 212K Nov 11 14:11 'MethodStats 9.64.191_vardata_L6_probin.txt'
-rwxr-xr-x 1 root root 171K Nov 11 14:11 'MethodStats 9.66.150_vardata_L6_probin.txt'
-rwxr-xr-x 1 root root 231K Nov 11 14:11 'MethodStats 9.72.194_vardata_L6_probin.txt'
-rwxr-xr-x 1 root root 241K Nov 11 14:11 'MethodStats 9.73.138_vardata_L6_probin.txt'
-rwxr-xr-x 1 root root 176K Nov 11 14:11 'MethodStats 9.83.123_vardata_L6_probin.txt'
-rwxr-xr-x 1 root root 179K Nov 11 14:11 'MethodStats 9.83.125_vardata_L6_probin.txt'
-rwxr-xr-x 1 root root 181K Nov 11 14:11 'MethodStats 9.83.195_vardata_L6_probin.txt'
-rwxr-xr-x 1 root root 176K Nov 11 14:11 'MethodStats 9.85.133_vardata_L6_probin.txt'
-rwxr-xr-x 1 root root 218K Nov 11 14:11 'MethodStats 9.85.167_vardata_L6_probin.txt'
-rwxr-xr-x 1 root root 195K Nov 11 14:11 'MethodStats 9.86.177_vardata_L6_probin.txt'
-rwxr-xr-x 1 root root 178K Nov 11 14:11 'MethodStats 23.92.166(1)_vardata_L6_probin.txt'
-rwxr-xr-x 1 root root 210K Nov 11 14:11 'MethodStats 9.89.189_vardata_L6_probin.txt'
-rwxr-xr-x 1 root root 218K Nov 11 14:11 'MethodStats 0.2048140_vardata_L6_probin.txt'
and output folder "result" has the same but before that is added FW Retest
/root/Documents/optimizer/result
-rwxr-xr-x 1 root root 3.4M Nov 11 14:14 'FW Retest - MethodStats 1.87.184_vardata_L6_probin.txt'
-rwxr-xr-x 1 root root 2.7M Nov 11 14:15 'FW Retest - MethodStats 0.2048140_vardata_L6_probin.txt'
-rwxr-xr-x 1 root root 2.5M Nov 11 14:15 'FW Retest - MethodStats 0.206117(4)_vardata_L6_probin.txt'
-rwxr-xr-x 1 root root 2.4M Nov 11 14:15 'FW Retest - MethodStats 23.92.166(1)_vardata_L6_probin.txt'
how to copy matching files from "datasets to opt
I doubt this is a regular expression problem. Best I can figure out you have files in directory A and you want to copy some of those to B. Then I can't follow what you want because it is either to overwrite or for the missing ones. In either case you will need a loop - which has nothing to do with regular expressions.