0

Iam not very familiar with powershell, I want to import csv data from multiple csv files in a directory. The files have the same structure, however I need to filter the output with a delimiter, because sadly all the data is compressed in one column.

I managed to import a single csv file with:

Import-Csv -Path C:\data\test.csv -Delimiter ‘;’  | select "Instance Name","Database ID","Database Name" .......

and successfully got a valid output in separate columns.

How can I actually pass multiple files one after another? After the import I want to export the data into MSSQL tables to work with it later on.

Thanks and BR, Patrick

2
  • stackoverflow.com/questions/50252209/… Commented Mar 15, 2019 at 13:05
  • Use a foreach to iterate the files from a Get-ChildItem i.e. foreach ($File in (Get-ChildItem -Path 'C:\data\*.csv')){Import-Csv $File -Delim ';' | Select-Object ....} Commented Mar 15, 2019 at 15:38

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.