Blowfelt82
asked on
Filter text output in powershell.
In powershell I am calling an executable file and capturing the output in the following format:
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).
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
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).
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Worked like a charm - thanks for your time.
ASKER