Document content is like this, which we want to save as one row in sql server Description about the document :
SQL Server Versions:
(a) SQL Server 2016 to be used for all upcoming projects;
(b) SQL Server 2016 Enterprise edition will be used on all servers
(i) SQL Server will be installed on VM instances
You'll need to parse the text into an object. Each property in the object becomes a column in the CSV. You can then pipe the objects to Export-CSV to create a CSV file.
You might play with ConvertFrom-String – it's able to take a "template" of what your data looks like, and then parse other data into objects based on the template. There are numerous tutorials, as well as the command help, on Convert-FromString.
The topic ‘Powershell - Save extracted content from word document as CSV file’ is closed to new replies.