sed to append on specific line in password file

I have the a group file and my ftp group line looks like this

ftp::49:cccmi,tngs,sloans,wlppdo,tsynergy,tuhcelpaso,tfuddruck,twlpmidwest,tocrproj,tbapco,tbdeuro,tclaimshop,tscselpaso,teldrpln,tpinnacle,tbdiap,tpacdent,tuhcmamsi,tinficr,tagia,tmwest,tppom2,tuhcfclm,tdatafax,tpcareclm,tbrinker,twlpdenscn,thdrtv,tmhead,tcqgpi,twlpmocha4,tsiapwf,tnbsrcm,tscsdbp,tcdwinv,tdiesel,tmayap,tbscclm,thdrsw,tavayaexp,tgegbsinv,tbrinkerte,tbrinkerpay,tuhcbefm,tbtob,tuhc,thdinv,tdbrands,ttwteleap,tpmswf,tmbusaap,tconveyw9,tkrogereaa,tuhcclm,tidg,tahold,uhcchk21,tlifecon,dcambap,tconfin,tiffap,tusc,tsfcc,tuhgingen,tstnhou,tuhgc,thps,twlpwest,tuhge,tibm,tphp,tbcbsnc,tmponenet,tdquick,tbdapac,tdirectv,tuhgag,tadds,tuhgpri,tcartus,taisi,twlppdo,trevmed,thmspay,tngspark,tfleetpr,tprg,tfordhri9,tcpkhrit,triver,thmsproj,thomeserve,tnyspit

I want to append a username using sed to the end of the line including the "," comma

See usermod , if that is used on your system. If not what is your OS and version?

I can 't use usermod because I can't update the software for it

try this:

sed '/ftp/ s/$/,username/' outputfile

if everything is working you can run:

sed -i '/ftp/ s/$/,username/' outputfile

p.s. I assumed you do not have groups ftp and ftp1, ftp2 ..etc