I'm working with a text file that looks something like this:

```

rs001  EEE /n
rs008  EEE /n
rs345  EEE /n
rs542  CHG /n
re432  CHG /n

```

I want to be able to collapse all of the rows that share the same value in column 2 into one single row (for example, `rs001 rs008 rs345 EEE`). Is there an easy way to do this using unix text processing or python?

Thanks