Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Rename multiple files based on their content

$
0
0

I am very much novice on powershell but I am trying to find(learn) a solution in powershell to rename several text files based on their content:

For eg:

I have a file with content in first line something like: CAT35;BAT46:A;RABBIT36:B;DOG32:C;SN00014,

I need to rename the file based on its content from 2nd (only alphanumeric: BAT45 from above example) and anything on last column before comma(SN00014 from above example) in its first line. So new name of the file should be BAT45SN000014.txt. (probably I need to use regex here).

Thank you very much for any help,

JBR


Viewing all articles
Browse latest Browse all 6937

Trending Articles


FLASHBACK WITH SIRASA FM AT GALGAMUWA 2022


Mp3 Download: Mdu - Mazola


Imitation gun was fired at motorist in Leicester road-rage incident


Ndebele names


MCKINNEY EMALINE “EMMA” OF WES...


Okra & Motia — The Workshop (Prod by Hammer)


Skint TV teen to be sentenced


Moondru Mudichu 19-09-2017 – Polimer tv Serial


YOSVANI JAMES Arrested by Miami-Dade County Corrections on Jan 10, 2017


Stories • Goddess Stepmom