title: Changes last name, first name to first name, last name in last column CSV powershell
body: <p>I am a newbie to powershell. I was trying to change last name, first name to first name, last name in the last column in CSV file and export all of the changes I have made to a new csv file. </p>
  
  <p>The data looks like this. </p>
  
  <blockquote>
    <p>Sport, Gender, Zip, Recruiter<br>
    "Baseball","Male", "12345", "John, Wayne"</p>
  </blockquote>
  
  <p>I tried using   </p>
  
  <pre><code>Get-Content "C:\import.csv" |    
  ForEach-Object {$_.Recruiter -replace ",", ""} |      
  ForEach-Object {$_.Sport -replace ",", ""} |     
  Set-content "C:\export.csv"  
  </code></pre>
  
  <p>This is a sample code, which, of course, doesn't work, but I have to change a bunch of punctuation to each column using ForEach-Object and want the last column "F_name L_name". When I used $_.Recruiter to call the column, I got only empty csv file. When I used Import-csv instead of Get-content, I got only the column selected and all other columns are lost. Any help would be very appreciated. </p>
  
  <p>Thank you. </p>