How can I add ",1" at the end of each of the lines using sed? The file I am using is like this;
A
B
C
I tried this;
sed 's/$/,1/' alphabets.txt > alphabets1.txt
and got this;
A
,1
B
,1
C
,1
but what I want is this;
A,1
B,1
C,1
When I tried the best answer from "https://stackoverflow.com/questions/15978504/add-text-at-the-end-of-each-line", I got a blank page.
sed -n 's/$/,1/' alphabets.txt > alphabets2.txt
I found out that there's ^M at the end using cat -vt file. How can I delete it and change it to ",1"?