Hey guys,
I've been reading through these threads:
[url]https://resource.dopus.com/t/create-folders-based-on-filenames-then-move-files-into-them/9290/1]
[url]Creating folders from filename]
[url]RegExp basics: Removing characters from start/end of names]
Trying to come up with a code which suits my needs... The idea is to take the 1 or 2 alpha characters from the middle of a file name, and move the files to folders based on these 1 or 2 alpha charachers.
For example, we have a collection of files such as:
- 1068-B1001.dwg
- 1068-B1002.dwg
- 1068-B1003.dwg
- 1068-DD1001.dwg
- 1068-DD1002.dwg
- 1068-DD1003.dwg
... and so on.
I would like to move these files into folders named only after the bold characters in the above list.
Ive been playing with some code, but I am really struggling to understand the REGEXP syntax.
My current code:
Rename PATTERN "(.*)-(^\w)([0-9]{4}).dwg" TO "\2\\\0" REGEXP
...Does nothing haha.
Just wondering if someone can please point out where I am going wrong, and set me straight.
Thanks a lot for any help.