From: Pen Ttt Date: 2010-04-13T20:17:41+09:00 Subject: how to delete the first two characters of each row? 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/.