Operating System - HP-UX
1825771 Members
2077 Online
109687 Solutions
New Discussion

Add a character at the end of each line

 
SOLVED
Go to solution
Muktha
Frequent Advisor

Add a character at the end of each line

Hi all,

I need to append a character at the end of each line of a file.
Can we use sed command here?
Could you please help me to do so?

Regards
Muktha
4 REPLIES 4
Suraj K Sankari
Honored Contributor
Solution

Re: Add a character at the end of each line

Hi,

Here is the solution

awk '{ print $0"yourword" }'outputfile

Suraj
Sagar Sirdesai
Trusted Contributor

Re: Add a character at the end of each line

If you want use sed below is the command

sed 's/$//' inputfile > outputfile

Sagar
Muktha
Frequent Advisor

Re: Add a character at the end of each line

Thank you very much Suraj,Sagar,

I got the expected output file.

Regards
Muktha
Muktha
Frequent Advisor

Re: Add a character at the end of each line

Thanks to all