(sorry for hijacking the thread like this!) On Wed, 2008-02-27 at 15:02 -0800, Bill Campbell wrote: <snip> > Another way on *nix systems that might be better wouldn't use > python at all. Edit the file in place with ed or ex: > > #!/bin/sh > ex - filename <<DONE > 1d > w > q > DONE > Errrr, how about: "sed -i.BACKUP -e '1d' filename"?
Much shorter, elegant, and obvious. (and it creates a backup file of the original.) After all, "sed" stands for: Stream EDitor. Ziyad. (again, sorry for hijacking the thread.) _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor