title: How to select required columns in csv file using powershell
body: <p>I have a csv file with data looking like this. </p>
  
  <pre><code>Div,Date,HomeTeam,AwayTeam,FTHG,FTAG,FTR,HTHG,HTAG,HTR
  I1,20/08/16,Juventus,Fiorentina,2,1,H,1,0,H
  I1,20/08/16,Roma,Udinese,4,0,H,0,0,D
  I1,21/08/16,Atalanta,Lazio,3,4,A,0,3,A
  I1,21/08/16,Bologna,Crotone,1,0,H,0,0,D
  </code></pre>
  
  <p>I am trying to export first six columns like below to a new csv file.</p>
  
  <pre><code>Div,Date,HomeTeam,AwayTeam,FTHG,FTAG
  I1,20/08/16,Juventus,Fiorentina,2,1
  I1,20/08/16,Roma,Udinese,4,0
  I1,21/08/16,Atalanta,Lazio,3,4
  I1,21/08/16,Bologna,Crotone,1,0
  </code></pre>
  
  <p>I am using the following powershell command. </p>
  
  <pre><code>Import-Csv $infile -DeLimiter ","|
  Select'Div','Date','HomeTeam','AwayTeam','FTHG','FTAG'| 
  Export-Csv $trimfile -DeLimiter "," -NoTypeInformation
  </code></pre>
  
  <p>But my output csv file looks like this</p>
  
  <pre><code>"Div","Date","HomeTeam","AwayTeam","FTHG","FTAG"
  "I1","20/08/16","Juventus","Fiorentina","2","1"
  "I1","20/08/16","Roma","Udinese","4","0"
  "I1","21/08/16","Atalanta","Lazio","3","4"
  "I1","21/08/16","Bologna","Crotone","1","0"
  </code></pre>
  
  <p>The no.of columns are much higher in the actual file. Simplified it here. What am I doing wrong?</p>