editing text files

Windows xp 2007
June 3, 2009 at 05:35:43
Specs: Windows XP, 2
i want to change some words in a text file with script or bat

example: change all "ab" words to "ba" in file1.txt then write new file into file2.txt

is this possible? is there anybody help me?

See More: editing text files

Report •

June 3, 2009 at 19:22:53
if you have Python on Windows
for line in open("file"):
    for n,item in enumerate(line):
        if item == "ab":
    print ' '.join(line)

Report •
Related Solutions

Ask Question