

# https://www.globalsino.com/ICs/page4853.html
# Insert a new text line after a line in a text file


with open("C:\GlobalSino\ICs\ExampleFiledUsedINtestingPython\Company.txt", "r") as f:
    MyDataFrame = f.readlines()

with open("C:\GlobalSino\ICs\ExampleFiledUsedINtestingPython\Company_Updated.txt", "w") as out_file:
    for line in MyDataFrame:
        if line == "XYZ\n":
            line = line + "IBM\n"
        out_file.write(line)

