The following script retrieves data from a MS Access database correctly.
I'd like the output file to NOT have the header and blank line at the beginning of the file.
Is there a way to suppress these lines?
A second question while I'm asking. I'm hardcoding the pipe delimiter as part of the query.
Is there options that can be added to have the system put in a pipe delimiter itself while creating the output lines?
$conn = New-Object Data.Odbc.OdbcConnection
$result =(new-Object Data.Odbc.OdbcCommand("select CMPIDE & '|' & CRTNOE & '|' & ENAMEE & '|' & DPTIDE & '|' & SEXCDE from a_table WHERE CMPIDE = 'AE';",$conn)).ExecuteReader()
$table = new-object "System.Data.DataTable"
$table | Out-File .\GroupLife-extract.csv