Darius
asked on
How to rename multiple files with their first 19 characters
Hi guys,
I would like to rename multiple files by replacing the name by their first 19 characters of their old name.
Can you please assist.
Orginal file naming:
0000000000000376279.xml.3b e03b33b7fd 403bb03fe2 7fd1167ffc .error
0000000000000376280.xml.7c 157a6cecf6 44cf934e91 9292339904 .error
0000000000000376281.xml.80 d7062d6cbc 4c689d7c82 c1e6ec35c7 .error
. . .
. . .
I want to achieve:
0000000000000376279.xml
0000000000000376280.xml
0000000000000376281.xml
. . .
script used in CMD doesn't work
exception: command is incorrect
Thank you
Darius
I would like to rename multiple files by replacing the name by their first 19 characters of their old name.
Can you please assist.
Orginal file naming:
0000000000000376279.xml.3b
0000000000000376280.xml.7c
0000000000000376281.xml.80
. . .
. . .
I want to achieve:
0000000000000376279.xml
0000000000000376280.xml
0000000000000376281.xml
. . .
script used in CMD doesn't work
exception: command is incorrect
ren -n 's/(.{19}).*(\.error)$' *.xml
Thank you
Darius
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks to Hello There for advice to use Powershell.
Thanks oBdA. Code working successfully.
Thank you Bill for answer to my question.