Adding things in a file and produce a new one

I wanna add a ":" at the end of each line, and i did something like this:

cat Totals | while read ID TOTAL
do
echo "${ID}:${TOTAL}:" >>Totals2
done

File: Totals
12345678:13
21443433:20

The outputs file Totals2 is:
12345678:13::
21443433:20::

but i want
12345678:13:
21443433:20:

so how can i do it?
Thank you

i find it out already.

let me guess. IFS=: ?? :slight_smile:

try this:

cat filename | sed 's/$/:/g'

output:

12345678:13:
21443433:20:

cheers,
Devaraj Takhellambam