This is the text in my file, which I'm editing with vim:
I want to change it to the the following content:
I have tried using this regular expression :%s/^.*$/\g<0>,\g<0>/g, but it's not working..
You can achieve that with the following replacement:
:%s/^.*$/&,&/
         ^ ^ 
The ^.*$ pattern will match the whole line, and & is a backreference to the whole match. So, the replacement is inserting back the whole match, a comma, and again the whole match. 
NOTE: The ^ and $ in this ^.*$ pattern can be omitted, but a lot of people prefer to keep them explicit in the pattern to facilitate pattern readability and further pattern testing.
An alternative in case you want to avoid matching empty lines:
:%s/.\+/&,&/
    ^^^
The .\+ will match 1 or more characters. 
g is useless at the end of the substitution as you are going to select all the line !!^ and $.using :s
%s/.*/&,&/
Note
^ and $ since the regex is greedy.g flag either. /Or use normal command:
%norm! yaWA,^R"
or
%norm! yg_A,^R"
the ^R, you press <c-v><c-r>
normal just like doing keystrokes in normal mode. read :h :norm  for help doc.  In this example, yaW yank the WORD, then A enter INSERT mode, added the , and <C-R> filled the yanked WORD. (yg_) will yank the whole line without the linebreak.Another way to do this without using regular expressions is to record a macro as you change the first line, then play the macro to change the remaining lines.
ggqay$A,<ESC>p+q4@a
Explanation:
gg move cursor to beginning of first line
qa start recording into register a
y$ copy the line
A go to insert mode at the end of the line
,<ESC> insert a comma and go back to normal mode
p paste the copy
+ move the cursor to the start of the next line
q stop recording
4@a play the macro four times to change the next four lines.
Execute these one by one:
:%s/abc/abc,abc/g
:%s/123/123,123/g
:%s/this/this,this/g
:%s/them/them,them/g
:%s/my/my,my/g
Similarly, replace the string with desired string for manipulating any string.
echo without using vim.:s accepts regex, obviously, you don't know how to use regex. to be honest, even if you wrote a shell script, your shell script is not a good one either. regex is very basic and important skill for vim and shell programming.
:%s/\v(.+)/\1,\1/