Quantcast
Channel: UNIX and Linux Forums
Viewing all articles
Browse latest Browse all 16232

Replace spesific letter in a file by other letter

$
0
0
Good afternoon all,
I want to ask how to change some letter in my file with other letter in spesific line

eg.
data.txt
Code:

1
1
1
0
0
0
0

for example i want to change the 4th line with character 1.
How could I do it by SED or AWK.

I have tried to run this code but actually did not modify the data.txt file and just print the result to screen.
Code:

sed -e "4s/0/1/" data.txt

Viewing all articles
Browse latest Browse all 16232

Trending Articles