I have a single folder containing files in this format
0167565-2017-06-01.pdf
0167565-2017-10-02.pdf
222648M-2017-08-01.pdf
222648M-2017-09-01.pdf
3082353642-2021-12-31.pdf
3082353642-2022-02-01.pdf
3082353642-2022-03-01.pdf
To the left of the first occurrence of the hyphen is always the account number.
I would like to create a directory for the account number then move all files of that account number to that directory.
The end result would be this.
0167565
-0167565-2017-06-01.pdf
-0167565-2017-10-02.pdf
222648M
-222648M-2017-08-01.pdf
-222648M-2017-09-01.pdf
3082353642
-3082353642-2021-12-31.pdf
-3082353642-2022-02-01.pdf
-3082353642-2022-03-01.pdf