Quantcast
Channel: PowerShell
Viewing all articles
Browse latest Browse all 15370

Import-CSV With Line Breaks

$
0
0

Hi All,

I'm trying to import a CSV and get the last column name however there is an issue where the export (from SQL) Contains line breaks.

Export from SQL:

Powershell
Invoke-SQLcmd-ServerInstance$dataSource-query$SQLQuery-U$user-P$pwd-Database$database|export-csv-path$DailySummaryCSV-notypeinformation

Output:

Text
"Depot","Member","13/11/2019 Wed","14/11/2019 Thu","15/11/2019 Fri","16/11/2019 Sat","17/11/2019 Sun","18/11/2019 Mon","19/11/2019 Tue","20/11/2019 Wed","21/11/2019 Thu","22/11/2019 Fri","23/11/2019 Sat","24/11/2019 Sun","25/11/2019 Mon","26/11/2019 Tue","27/11/2019 Wed" "1","Member1 ","10","16","2","0","0","3","59","0","0","1","0","0","0","0","0" "2","Member2 ","4702","4650","4419","1528","150","5553","4962","4618","4641","4069","1467","127","5095","4803","4212" "4","Member3...

Viewing all articles
Browse latest Browse all 15370

Latest Images

Trending Articles



Latest Images

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