

# https://www.globalsino.com/ICs/page4853.html
# Insert a text at the end of a line in a text file

import fileinput

MyFileName = r'C:\GlobalSino\ICs\ExampleFiledUsedINtestingPython\Company.txt'
# "inplace = 1" means passing the line overwrite the file
for line in fileinput.FileInput(MyFileName, inplace=1):
    if 'GlobalSino' in line:
        line = line.rstrip()
        line = line.replace(line,line + ' is very good' +'\n')
    print (line, end ='')

        

