Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

How to remove @domain.com from each cell of Excel using PowerShell?

$
0
0

Hello,

For e.g. below is my First.CSV

Display Name        UserPrincipalName                   

-----------------------------------------------------    

Apple Fruit            Apple.Fruit@domain.com     

Mango Fruit          Grapes.Fruit@domain.local    

Orange Fruit         of123@newdomain.org        

  

Here, I wish to extract the Alias from Alias@domain.com from field UserPrincipalName of ImportedFirst.csv and it should be pasted in field sAMAccountName with all other fields in output new/exportedSecond.CSV

Just like in Second.CSV with whole row as shown below.

Display Name        UserPrincipalName                sAMAccountName        

--------------------------------------------------------------------------------------  

Apple Fruit            Apple.Fruit@domain.com            Apple.Fruit          

Mango Fruit          Grapes.Fruit@domain.local         Grapes.Fruit

Orange Fruit         of123@newdomain.org               of123


Thanks, Divyaprakash Koli


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>