Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python sys replace text

import sys
import fileinput
  
x = input("Enter text to be replaced:")
y = input("Enter replacement text")
  
for l in fileinput.input(files = "file.txt"):
    l = l.replace(x, y)
    sys.stdout.write(l)
Source by es.acervolima.com #
 
PREVIOUS NEXT
Tagged: #python #sys #replace #text
ADD COMMENT
Topic
Name
8+8 =