marco.shaw Posted November 27, 2006 Report Share Posted November 27, 2006 Perhaps something useful for others... I asked a question in the forum here, and the microsoft.public.windows.powershell newsgroup about whether the import-csv output could be copied using some other cmdlet like write-output... Yes it can! PS C:\> gc country.csvCountry,PointsU.S.A.,20Canada,10PS C:\> import-csv country.csv Country Points------- ------U.S.A. 20Canada 10 PS C:\> "U.S.A.,20","Canada,10"|select-object @{e={$_.split(',')[0]};n='Country'},@{e={$_.split(',')[1]};n='Points'} Country Points------- ------U.S.A. 20Canada 10 So, instead of using import-csv to pipe to out-map, one can use write-output or as illustrated above. I haven't tried it yet, but that might keep me from having to write temporary files in some scripts of mine. I might also be able to throw in scriptblocks into the data piped to out-map. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.