well, that IS the output i wanted. oh my gawd but thats a confusing replacement statement! jeez now MY head is being messed with... thank you it worked thank you! is there a simpler way of doing it? im not exactly a scholar of perl and i can pretty much understand it, but if possible id like a little more detailed explination of how it works. if you dont want to be more desctiptive, thats ok. jeez, it must have taken you about 5 seconds to make that too... and im still reading text files in line by line. (well, some). i wish i was smart, i wish i was smart, i wish i was smart...