Results 1 to 4 of 4
Hi,
I have one file with data in the following order
0x12
0x23
0x34
0x45
I need to append ',' (i.e Comma) at the end of each line.
How to ...
- 08-05-2008 #1Just Joined!
- Join Date
- Dec 2007
- Posts
- 28
appending data using sed
Hi,
I have one file with data in the following order
0x12
0x23
0x34
0x45
I need to append ',' (i.e Comma) at the end of each line.
How to do it using sed?
can anyone please guide me?
- 08-05-2008 #2Linux Newbie
- Join Date
- Jul 2008
- Posts
- 181
sed 's/$/,/' input_file
- 08-06-2008 #3Just Joined!
- Join Date
- Dec 2007
- Posts
- 28
Hi,
Thanks for your mail.
If I create a file in Vi editor and execute the above command it works. But If i create .txt file in windows and try this command ","(Comma) is placed at the beginning.
My understanding is $ represents end of line. But why in .txt it is in the beginning?
- 08-06-2008 #4Just Joined!
- Join Date
- Dec 2007
- Posts
- 28
Hi ,
Thanks. I found the cause. it is due to ^M


Reply With Quote