Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • 1
    Here some oneliner based on your idea: $ibm_ex_vols-replace"(?<=^($(([Regex]::Matches($ibm_ex_vols[0],' \S').Index|%{".{$_}"})-join'|'))) ",','. Commented Oct 14, 2015 at 20:54
  • So that is a nice short way to get comma separated output. The result is that it prints that output to the screen which is not what I was shooting for. What I really need is to be able to take that string and parse out the ID and Name headers and values and ideally display in a table. I can do this easily if I can export the data to a CSV, import and then use select-object. I was hoping to avoid the import export route if possible. Commented Oct 14, 2015 at 21:16
  • @PetSerAl Nice one. Looks like a perl hack though. ;) I think retaining some readability is more practical even at the cost of some extra lines. Commented Oct 14, 2015 at 21:19
  • @SteveKehrer You can pipe strings to ConvertFrom-Csv, and get objects without exporting and importing. Commented Oct 14, 2015 at 21:24