I have a number -> 12345
I want output in below format
1+2+3+4+5
echo `cat fl.txt | paste -s -d ''`
gives only 12345
.
But when I add this + at the below command it gives same 12345
.
echo `cat fl.txt | paste -s -d '' | tr -s '' '+'`
text processing
I have a number -> 12345
I want output in below format
1+2+3+4+5
echo `cat fl.txt | paste -s -d ''`
gives only 12345
.
But when I add this + at the below command it gives same 12345
.
echo `cat fl.txt | paste -s -d '' | tr -s '' '+'`
Best Answer
With GNU sed, you can also do: