4

i want to use sed to replace any x(small) to 0 if the line contains Z(capital)

x,Z,y y,X,z, Y,z,x x,Z,y 

1 Answer 1

8
$ sed '/Z/s/x/0/g' <input_file> 
0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.