Tried the code but give this error:

C:/Ruby192/lib/ruby/1.9.1/csv.rb:1892:in `block (2 levels) in shift': 
Unquoted fields do not allow \r or \n (line 1). (CSV::MalformedCSVError)
from C:/Ruby192/lib/ruby/1.9.1/csv.rb:1863:in `each'
        from C:/Ruby192/lib/ruby/1.9.1/csv.rb:1863:in `block in shift'
        from C:/Ruby192/lib/ruby/1.9.1/csv.rb:1825:in `loop'
        from C:/Ruby192/lib/ruby/1.9.1/csv.rb:1825:in `shift'
        from C:/Ruby192/lib/ruby/1.9.1/csv.rb:1767:in `each'

y?

Btw thanks guest and yjw for the post

Nizam

-- 
Posted via http://www.ruby-forum.com/.