我有一个包含这样内容的文本文件
customer-1 Product-2
customer-1 Product-3
customer-1 Product-7
customer-2 Product-20
customer-2 Product-12
...
我想格式化它
customer-1 Product-2, Product-3, Product-7, Product-20
customer-2 Product-20, Product-12
...
如何在shell脚本或php中做到这一点?
谢谢