I was wondering if I could use a command + regex in the terminal to move files in different subfolders:

I have 1 x big folder that has lots of .txt files

I am trying to group these .txt files in separate subfolders based on a specific pattern (on what subfolder they belong to):

LARGE FOLDER:<br>
file1.txt<br>
file2.txt<br>
...<br>
file100.txt<br>

The rules would be:
1. file1.txt<br>
file3.txt<br>
file8.txt

belong to "subfolder1"

2. file2.txt<br>
file4.txt<br>
file23.txt

belong to "subfolder2"

etc

Here's the [list of rules in a CSV][1]; first column are the filenames and 2nd column is the subfolder in which I wanna move them to.

That's what I am trying to achieve. There's no specific pattern based on numbers, the "file1", etc can have other names, so don't look at the numbers in the filenames as a pattern.

**Would there be a way to move these .txt files in their respective subfolders based on a terminal command like "mv" + regex + also read these rules from the CSV file mentioned above?(not sure if even possible)**

I tried something like this

```
mv file1.txt,file3.txt,file8.txt* /subfolder1
```

but seems counterproductive to do it manually for each without the rules :(

Any help would be greatly appreciated!


 [1]: https://www.dropbox.com/s/c9uynbdvvduez0q/rules%20files%20subfolders.csv?dl=0