Hello,
I want to change a line at file whit a script
i want to change line 150 for example, write hello and remove text of this line
EXAMPLE
LINE 150: my mother
change to:
LiNE 150: HELLO
Hello,
I want to change a line at file whit a script
i want to change line 150 for example, write hello and remove text of this line
EXAMPLE
LINE 150: my mother
change to:
LiNE 150: HELLO
sed '150s/.*/HELLO/' infile
try:
sed "150s/.*/HELLO/" FICHERO_IN
thanks, but....how i can save the file?
waht is .*���
tahnks
Hello,
I recommend you read: Sed - An Introduction and Tutorial
.* is:
. = any character
so, .* is "any phrase".
Then sed change "any phrase" in the line 150 for "HELLO".
You can redirect to other file with >:
sed "150s/.*/HELLO/" FILE_IN > FILE_OUT