Remove first and last three character of a word with powershell -
i have list of users in text file who's names in following format: xn-tsai-01.
how script remove xn- keep -01 output like: tsai
i know how in bash not familiar powershell.
thanks in advance!
here quick way using regex:
'xn-tsai-01' -replace '.*?-(.*)-.*','$1' example list:
(get-content list.txt) -replace '.*?-(.*)-.*','$1'
Comments
Post a Comment