0

I have below pattern in my file at different lines

""key"": null

I want to replaceu this to

""key"": ""test""

through linux

i used the below commands:

sed -i 's/ null / ""test"" /'
sed -i 's/ null / \"\"test\"\" /'

but failed.

1 Answer 1

1

This should do it:

 sed -i 's/null/\"\"test\"\"/g' file.txt
Sign up to request clarification or add additional context in comments.

3 Comments

it is also removing the delimiter from the files, replacing comma to space
comma in where?
sorry that was my mistakes i used this wrongly, thanks @Arash

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.