Link to home
Start Free TrialLog in
Avatar of Blowfelt82
Blowfelt82

asked on

Filter text output in powershell.

In powershell I am calling an executable file and capturing the output in the following format:

A1         A111        B111      C111
              A222        B222      C222
              A333        A333      C333
B1         B111        B111      B111
              B222        B222      B222
              B333        B333      B333
C1         C111        C111      C111
              C222        C222      C222
              C333        C333      C333

Open in new window


This is returned as string which I capture into a variable, what I need is a nice way to filter this data by column1 (where all blank column data under column 1 equals that of the value above), and then create an array of the filtered data so I can access each row/column data as required. The spacing between the columns is multiple plain spaces - but to spice things up a bit column 2 includes data with spaces (but only single spaces so hopefully this should be do'able).
Avatar of Blowfelt82
Blowfelt82

ASKER

Note: The formatting has got messed up - these columns should form aligned columns.
ASKER CERTIFIED SOLUTION
Avatar of Qlemo
Qlemo
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Worked like a charm - thanks for your time.