I have an input file as follows
hello: hello12
foo: bar14
test3: pppp
more: stuff
test14: bla
Is there a way to use the first column as header and separate it by comma's as follows:
hello,foo,test3,more,test14
hello12,bar14,pppp,stuff,bla
I've tried a few things at no success.
,? What are the few things you tried?cut -d: -f1 file | tr '\n' ','but this will get first column onluhello, foo, test3should be the header. Let me update the question. THe first column is seperated by a colon:and it doesn't matter how long the first column is, it should be used as the header.