Take a look at the man page for 'sed'. It is very powerful and has a bit of a learning curve but it will do what you want. Doug -- Doug Lawlor <dlawlor at roadrunner.nf.net>