title: Powershell skip first 2 lines of txt file when importing it
body: <p>I have a powershell script designed to read a txt file on a remote server and import it into SQL.</p>
  
  <p>I want to be able to skip the first 2 lines of the txt file.  I am currently using the code below to import the file.  The txt file is delimited </p>
  
  <pre><code>$datatable = new-object System.Data.DataTable
  $reader = New-Object System.IO.StreamReader($empFile)     
  $columns = (Get-Content $empfile -First 1).Split($empFileDelimiter) 
  
      if ($FirstRowColumnNames -eq $true) 
  
          { 
              $null = $reader.readLine() 
  
          } 
  
      foreach ($column in $columns) 
  
          {  
              $null = $datatable.Columns.Add() 
          } 
  
      # Read in the data, line by line, not column by column 
      while (($line = $reader.ReadLine()) -ne $null)  
  
          { 
  
              $null = $datatable.Rows.Add($line.Split($empFiledelimiter)) 
  </code></pre>
  
  <p>The column parameter takes the first line of the txt file and creates the columns for the PS datatable.  </p>
  
  <p>The problem I have is the first two lines of the txt file are not needed and I need to skip them and use the third line of the txt file for the columns.  I have the following line of code which will do this but I am uncertain how to integrate it into my code.</p>
  
  <pre><code>get-content $empFile | select-object -skip 2 
  </code></pre>