You can do this pretty easily with sed - sed -i 's/$/A/' file.txt
- squiguy
Be careful to -i flag, it overrides file.txt in-place
- EnthusiastiC
You can use this sed -e '1 s/$/400/' -e '2 s/$/401/' -e '3 s/$/402/' -e '4 s/$/403/' file.txt to add at end of each line a specified character (e.g., here I used numbers 400-403). The number 1,2, and 3 reflects the line index.
- EnthusiastiC
1 Answers
51
votes
this may do the job for you
awk '{print $0"A"}' yourFile
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkRead more
sed -i 's/$/A/' file.txt- squiguy-iflag, it overrides file.txt in-place - EnthusiastiCsed -e '1 s/$/400/' -e '2 s/$/401/' -e '3 s/$/402/' -e '4 s/$/403/' file.txtto add at end of each line a specified character (e.g., here I used numbers 400-403). The number 1,2, and 3 reflects the line index. - EnthusiastiC