Project

General

Profile

« Previous | Next » 

Revision 358

repl: Process whole file as one string so that regexps can match EOF for appending

View differences:

repl
46 46
        for row in reader:
47 47
            row[col_num] = repl_all(row[col_num])
48 48
            writer.writerow(row)
49
    else:
50
        while True:
51
            line = sys.stdin.readline()
52
            if line == '': break
53
            sys.stdout.write(repl_all(line))
49
    else: sys.stdout.write(repl_all(sys.stdin.read()))
54 50

  
55 51
main()

Also available in: Unified diff