M
moondaddy
I need to rename file names with a specific naming convention which includes
adding a SKU number at the end of the file name and I would like to use a
regular expression to do this, but I don't even know where to start on this
one.
For example say my file name is MyFileName.jpg and my SKU number is 1234. I
need to rename the file to
MyFileName---1234.jpg where the sku number gets prefixed with "---".
However, since there will be a large volume of file names to process and I
don't have any control of the original name coming in, I may have to clean
the name a bit first. For example the file name could possibly end with a
"-" or " -" or "_" or " _" in which case I would need to strip these off
first.
Can anyone help me with a regular expression to do this?
Thanks in advance.
adding a SKU number at the end of the file name and I would like to use a
regular expression to do this, but I don't even know where to start on this
one.
For example say my file name is MyFileName.jpg and my SKU number is 1234. I
need to rename the file to
MyFileName---1234.jpg where the sku number gets prefixed with "---".
However, since there will be a large volume of file names to process and I
don't have any control of the original name coming in, I may have to clean
the name a bit first. For example the file name could possibly end with a
"-" or " -" or "_" or " _" in which case I would need to strip these off
first.
Can anyone help me with a regular expression to do this?
Thanks in advance.