I can connect to a csv file using OLEDB but I do not know how to force text output as when an IP Address is returned I believe it is looking at it as a numeric field and is improperly formatted. I presume Powershell Import-CSV module has this built in as it displays correctly.
Code to connect to a .csv file and read IP Address column
I am not proficient in PowerShell coding nor messing with arrays and having to use cryptic synatx whereas I am familiar with sql syntax and queries
From researching:
Import-CSV with large files, can exhaust all of your RAM…The file I have is large and it takes way to long…the IP Address is just one column out 100k+ rows from a data dump
Eventually, I will dig into the various methods/properties PowerShell offers but if OLEDB can be faster and I know immediately how to create the quiers I need in SQL then I have to go this route - thanks for replying!
You’re correct…the IP Address field is indeed not surrounded by quotes. Unfortunately, I have no control over this as the data is from a server dump I have no access to. I thought perhaps PowerShell had a switch or a command to apply on that datareader …so, I thought I’d post something here.
Understandable, Import-Csv has a -Header switch so you can import only the columns you want and technically that could be fed to sort-object, group-object etc and only store a subset of the data in memory
Yes…I do realize powershell has the tools i need to do what i have to do with the data…I may end up posting back with a grouping > dashboard simulation post
I will be trying out the header switch to see if that makes a difference on the import - thanks for that info!