From: Tony Arcieri Date: 2010-04-14T02:26:55+09:00 Subject: Re: how to delete the first two characters of each row? --000e0cd240c6848b7a04842190cc Content-Type: text/plain; charset=ISO-8859-1 Another option, utilizing Ruby's mutable strings: while line = io.gets line.slice!(0, 2) io1.write line end On Tue, Apr 13, 2010 at 5:17 AM, Pen Ttt wrote: > 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? > -- > Posted via http://www.ruby-forum.com/. > > -- Tony Arcieri Medioh! A Kudelski Brand --000e0cd240c6848b7a04842190cc--