You can try this sed command sed 's/,(.*china)/,Tomas_proxy.lt/1/' FileName or sed 's/,(.*china)/,Tomas_proxy.lt/1/' FileName > NewFile or sed -i.bak 's/,(.*china)/,Tomas_proxy.lt/1/' FileName