> trying to write a simple script that removes the >>>'s from > the beginning of lines in a text file Sounds like a job for reg expressions to me. the regexp will be something like: >[> ]+ which means a '>' followed by one or more '>' or spaces. The sub function/method in the re module should replace that with an empty string. Alan G.