I have a huge text file (about 500 MB) with a tab delimiter. It does not contain headers. It looks like this:
20140711 IBM 29.9068 tom.smith@ibm.com this is interesting
20140712 HP 2.3000 tom.smith@ibm.com this is interesting
20140713 GOOGLE 44.9033 tom.smith@ibm.com this is interesting
20140714 HTC 739.70 tom.smith@ibm.com this is interesting
20140715 SAMSUNG 8.442 tom.smith@ibm.com this is interesting
20140716 MICROSOFT 67.104 tom.smith@ibm.com this is interesting
20140717 DELL 5.0823 tom.smith@ibm.com this is interesting
...
...
...
I need to use Powershell to load text into a SQL Server database as a table. Since there are no headers in the text file, the Import-Csv cmdlet does not display the contents correctly. I think it always treats the first line as headers.
How does "Import-Csv" display the entire contents of a text file and forget about the header configuration?
Thank.
source
share