From: Vidya Vidya Date: 2007-10-17T14:08:25+09:00 Subject: Re: How to remove "~" in those files thanks for reply, actually i want to remove only end of the last record "~", to each file, here this is my coding, please let me, in this i should remove the last "~" only. Dir["#{dirname}/**/**"].each do | thisfile | @m=@m+1 thisfile.gsub! ( /\// , '\\' ) results.push ( thisfile ) f = File.open(thisfile,"r") @read_file=f.read() @split_record=@read_file.split("~") // i am spiliting the records @split_record.each do |v| @split_data=v.split("\*") // here my inner process end end but i want to remove last sysmbol at the end of the each file, if i don't remove the "~" means , i couldn't get output as right, otherwise if you have any idea please let me know -- Posted via http://www.ruby-forum.com/.