Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

How To Parse the Output of the Command

$
0
0

Hi there!

Here is my scenario:

  1. Command Prompt application returns the output which contains several lines.
    C:>MyCommand parameter1

    The output is:
    User1 has a balance of 10.00
    User1 has a free quota of 0.00
     
  2. We need
    1. To get only the first line of output, i.e. "User1 has a balance of 10.00"
    2. Separate each word with commas (or tabs), substitute the spaces with designated characters like:
      User1,has,a,balance,of,10.00

Would you be so kind to implement that script. I tried to deal with export-csv command, but it did not work out :(

Thank you very much for your time and attention!


Viewing all articles
Browse latest Browse all 6937

Trending Articles