Create file from CSV

hi Guys.

so I have a .csv file with a column called name. This column has different names and some with spaces in them.

what I am looking to do is create a blank .cfg file based on the value of each row within column.

any help on reading and creating the .cfg. I have thousands so don’t want to do this manually. Been ages since I played with PowerShell and need to find my head again with it.

thanks in advance.

Well without seeing an example of the csv or an example of the output, I couldn’t be very specific. Recommend looking at Import-Csv. This will import your file as an array of custom objects each with a “name” property. From there depending on what you need to transform you could use a foreach loop or many other methods to transform each object. With an example, I might be able to recommend some other methods. After any necessary transformation you could simply write the cfg with New-Item