From: Mirko Viviani Date: 2009-07-23T21:17:02+09:00 Subject: Re: splitting............. --001485f6d910e4cdc7046f5e7624 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable something similar... fi =3D File.open("yourfile", "r") #get key values header =3D fi.gets.chomp.split(",") allValues =3D [] while (!fi.eof) values =3D fi.gets.chomp.split(",") allValues << header.zip(values) end fi.close puts allValues.inspect 2009/7/23 Hunt Hunt > Hi Friends, > > I have a file which information.txt which is like > > name,address,city,contact > abc,Newyork,HYU,345 > xyz,Pittsurg,UYY,234 > > > only theree line. > > Now I have to split name, address,city & contact with their associated > values. > > how am i supposed to do this? > > Thanks for the information in advance. > > Regards > HUNT/RUDIN > -- > Posted via http://www.ruby-forum.com/. > > --=20 -- Mirko Viviani -- GPG-PGP Public Key: 0xE4E8FAB1 Fingerprint: 14D3 A373 E926 7737 DF32 502B A4C4 1CE2 E4E8 FAB1 *********************************************** "=93Machines take me by surprise with great frequency.=94 A. Turing --001485f6d910e4cdc7046f5e7624--