Skip to main content
edited tags
Source Link
terdon
  • 252.3k
  • 69
  • 480
  • 718

I have 3000 words that are repeated (ARG ARG ARG ARG ....)

I am trying to search and replace the 500th word by 'UIO'

I have been trying it with sed -i 's/ARG/UIO/500' filename.txtsed -i 's/ARG/UIO/500' filename.txt

I have also tried it with sed -i 's/ARG/UIO/500g' filename.txtsed -i 's/ARG/UIO/500g' filename.txt but it does not work.

I does not report any mistake but it doesntdoesn't change anything in filename.txtfilename.txt either.

What would you recommend me to do?

I have 3000 words that are repeated (ARG ARG ARG ARG ....)

I am trying to search and replace the 500th word by 'UIO'

I have been trying it with sed -i 's/ARG/UIO/500' filename.txt

I have also tried it with sed -i 's/ARG/UIO/500g' filename.txt but it does not work.

I does not report any mistake but it doesnt change anything in filename.txt either.

What would you recommend me to do?

I have 3000 words that are repeated (ARG ARG ARG ARG ....)

I am trying to search and replace the 500th word by 'UIO'

I have been trying it with sed -i 's/ARG/UIO/500' filename.txt

I have also tried it with sed -i 's/ARG/UIO/500g' filename.txt but it does not work.

I does not report any mistake but it doesn't change anything in filename.txt either.

What would you recommend me to do?

edited tags
Link
Jeff Schaller
  • 68.8k
  • 35
  • 122
  • 265
Source Link

Sed flag is not working

I have 3000 words that are repeated (ARG ARG ARG ARG ....)

I am trying to search and replace the 500th word by 'UIO'

I have been trying it with sed -i 's/ARG/UIO/500' filename.txt

I have also tried it with sed -i 's/ARG/UIO/500g' filename.txt but it does not work.

I does not report any mistake but it doesnt change anything in filename.txt either.

What would you recommend me to do?