Transforming Rows into Columns from awk to Powershell

Hello Guru's,

EDIT: I do have an awk script that does most of the job for me. An equivalent to this awk script would be just fine. 

awk '{t=$1;gsub(/"/,"",t);a[t]=a[t] FS $0} END {for (i in a) print a[i]}' filename

Making sure I post under the right category...windows powershell!

I have an awk script that does the job somewhat but I need a powershell script that transforms rows into columns.

Basically I need to join the rows into columns if the first column has the same value. 

Below is the sample input file.
A 1,2,3
A 4,5,6
B 1,2,3
B 4,5,6
C 1,2,3
C 2,3,4
C 3,4,5

Here is the desired output: 
A 1,2,3,4,5,6
B 1,2,3,4,5,6
C 1,2,3,2,3,4,3,4,5

Cheers for any help :-)


September 7th, 2015 10:25pm

Sorry - That was my first post. I realized that I should've posted it under the windows power shell category. 

Apologies...

September 7th, 2015 11:20pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics