How would i join two lines usung awk or sed?
for eg:
i have data like below:
abcd
joinabcd
efgh
joinefgh
ijkl
joinijkl
i need oupput like below:
joinabcdabcd
joinefghefgh
joinijklijkl
How would i join two lines usung awk or sed?
for eg:
i have data like below:
abcd
joinabcd
efgh
joinefgh
ijkl
joinijkl
i need oupput like below:
joinabcdabcd
joinefghefgh
joinijklijkl
awk 'BEGIN{i=1}{line[i++]=$0}END{j=1; while (j<i) {print line[j+1] line[j]; j+=2}}' yourfile
No need for sed.