I have one file with below content.
Quote:
$cat file1
#
web1
id1
user1
edl1
#
web2
id2
user2
edl2
#
web3
id3
user3
edl3
|
There are 5 lines after every "#" charecter. I want teh content of every line to be placed horizontally after #.
The file should look like the one below.
Quote:
$cat file2
# web1 id1 user1 edl1
# web2 id2 user2 edl2
# web3 id3 user3 edl3
|
OR
Quote:
$cat file2
#,web1,id1,user1,edl1
#,web2,id2,user2,edl2
#,web3,id3,user3,edl3
|
I know if the content would have been in different files, paste command would have made the trick. But I dont know how to achieve it in this scenario. I believe sed can do it. Anyone can please help.
Thanks,
Ravi