Delete only a portion of an object


i new powershell and trying feet wet. i'm trying convert specific objects from .lst file .csv. of objects want convert begin "description=" , omit these words prior conversion.

here script far:

get-content i:\xxxxx\xxxxxxx\test.lst | select-object -index 42, 46, 50, 58, 230, 414 | set-content i:\xxxxx\xxxxxxx\test.csv

output excel file , lines display:
description=adobe
description=office2013
description=rhapsody
...etc,etc,etc

cannot alter .lst file so need script copy portions of data. thing haven't been able find is how omit "description=".

hope clear enough help. let me know if need else.

get-content i:\xxxxx\xxxxxxx\test.lst |              select-object -index 42, 46, 50, 58, 230, 414 |                                   foreach {$_ -replace 'description='}

output

rhapsody
adobe
office2013




Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

server manager error: ADAM.events.xml could not be enumerated.

Cannot access Anywhere Access using domain name?

WMI Failure: Unable to update Local Resource Group