I think you would have to read one pass through the file to get the column headings, i.e. Name values. Then you would have to close and reopen the file (to start at the beginning of the file) and read through again, this time looking only at the values. I am assuming each system has the same number of entries for the file.
From: [email protected] [mailto:[email protected]] On Behalf Of CESAR.ABREG0 . Sent: Wednesday, September 18, 2013 1:06 PM To: [email protected] Subject: Re: [powershell] RE: convert text to a csv I don't think that would do the trick. how about open it with Excel and do text to column? On Wed, Sep 18, 2013 at 9:54 AM, <[email protected]<mailto:[email protected]>> wrote: So If I pull the file into an object, piping that to export-csv will work? Christopher Catlett Consultant | Detroit [cid:[email protected]] Sogeti USA Office 248-876-9738<tel:248-876-9738> |Fax 877.406.9647<tel:877.406.9647> 26957 Northwestern Highway, Suite 130, Southfield, MI 48033-8456 www.us.sogeti.com<http://www.us.sogeti.com/> From: [email protected]<mailto:[email protected]> [mailto:[email protected]<mailto:[email protected]>] On Behalf Of Lutz, Ken Sent: Wednesday, September 18, 2013 12:43 PM To: [email protected]<mailto:[email protected]> Subject: [powershell] RE: convert text to a csv Christopher, Are you looking for the cmdlet Export-CSV? http://technet.microsoft.com/en-us/library/ee176825.aspx Thanks, Ken ... From: [email protected]<mailto:[email protected]> [mailto:[email protected]] On Behalf Of [email protected]<mailto:[email protected]> Sent: Wednesday, September 18, 2013 9:22 AM To: [email protected]<mailto:[email protected]> Subject: [powershell] convert text to a csv I have a file with many entries like the below, trying to convert them into a csv, my googling is failing me today. Name Value ---- ----- Model 25184HU Cores 4 RAM 2 Vendor LENOVO Manufacturer LENOVO Sockets 1 CSModelType ThinkPad T410 IdentifyingNumber R88TGZ7 Hostname SystemType X86-based PC Christopher Catlett Consultant | Detroit [cid:[email protected]] Sogeti USA Office 248-876-9738<tel:248-876-9738> |Fax 877.406.9647<tel:877.406.9647> 26957 Northwestern Highway, Suite 130, Southfield, MI 48033-8456 www.us.sogeti.com<http://www.us.sogeti.com/> ================================================ Did you know you can also post and find answers on PowerShell in the forums? http://www.myitforum.com/forums/default.asp?catApp=1 ================================================ Did you know you can also post and find answers on PowerShell in the forums? http://www.myitforum.com/forums/default.asp?catApp=1 ================================================ Did you know you can also post and find answers on PowerShell in the forums? http://www.myitforum.com/forums/default.asp?catApp=1 ================================================ Did you know you can also post and find answers on PowerShell in the forums? http://www.myitforum.com/forums/default.asp?catApp=1 ================================================ Did you know you can also post and find answers on PowerShell in the forums? http://www.myitforum.com/forums/default.asp?catApp=1
<<inline: image001.jpg>>
