From: Robert Klemme Date: 2010-04-13T23:37:45+09:00 Subject: Re: how to delete the first two characters of each row? 2010/4/13 Pen Ttt : > how to delete the first two characters  of each row? > i want to delete the first two characters  of each row in file > /home/pt/test/mtp.txt > > > io=open("/home/pt/test/mtp.txt","r") > io1=open("/home/pt/test/mtpback.txt","w") > while line=io.gets >   ioput=line.delete("/^..../") >   io1.write(ioput) > end > > when i open /home/pt/test/mtpback.txt,there is not what i want,where is > wrong? At your favorite shell prompt: $ cut -c 3- /home/pt/test/mtp.txt >| /home/pt/test/mtpback.txt Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/