Artificial intelligent assistant

How to combine three lines into one, separated by comma How to turn this text: From: "anonymous" <sip:anonymous@test.com>;tag=1c1969267918 Call-ID: 3227998302912020104951@192.168.1.10 Max-Forwards: 70 From: "anonymous" <sip:anonymous@test.com>;tag=1c6447025742 Call-ID: 1426914846291202010505@192.168.1.10 Max-Forwards: 70 Into this one: From: "anonymous" <sip:anonymous@test.com>;tag=1c1969267918, Call-ID: 3227998302912020104951@192.168.1.10, Max-Forwards: 70 From: "anonymous" <sip:anonymous@test.com>;tag=1c6447025742, Call-ID: 1426914846291202010505@192.168.1.10, Max-Forwards: 70

Unless the single space after the commas in your expected output are very important:


$ sed 's/^[[:blank:]]*//' file | paste -d, - - -
From: "anonymous" ;tag=1c1969267918,Call-ID: 3227998302912020104951@192.168.1.10,Max-Forwards: 70
From: "anonymous" ;tag=1c6447025742,Call-ID: 1426914846291202010505@192.168.1.10,Max-Forwards: 70


This first uses `sed` to remove the initial whitespace on each line in the input file, and then distributes the resulting lines, using `paste`, across three columns with commas as delimiters.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 0fe58f13a806b3ddec0b94534a0eafea