From: Vidya Vidya Date: 2007-10-10T21:43:48+09:00 Subject: data count problem in array hi all, now i am facing problem with count, actually i need to count the data after spliting like this is my one data @aa=LIN*EDIA000005*000000570*570*0697*RC*SHEPLER'S EXCLU*100*SHEPLER'S EXCLUSIVE*6042142403*SHEPLERS COGNAC HORNBACK CAIMAN TAIL*20070719*20070719**02*724178914197******070 A**********************50384~ - i need to split based on *,if you split base on *, we can get number count 44, but in coding i don't know how to count in array, i user @a.size function, but its shows the count no 1 only, please help me to count this record and get the array index. i have given my coding, what i tried in below, @a=@aa.split("~") @a.each do |v| @h=v.split("*") @test=@h.size end return @test This is the sample records, this record will follows one by one at the end of ~. -- Posted via http://www.ruby-forum.com/.