From: James Edward Gray II Date: 2011-01-24T06:31:39+09:00 Subject: Re: Obtain 'CSV' data On Jan 23, 2011, at 3:23 PM, Kamarulnizam Rahim wrote: > I have some problem while obtaining data from the csv file format. Here > is the output of the csv file after being loaded in ruby: > > "1.a | Maximise use of natural lighting | | Active | | | | | | " > "1.b | Turn-off unnecessary lights/equipment | | Active | | | | | > | " It doesn't look like you really need a CSV parser there. I suggest: File.foreach(path) do |line| fields = line.split(/\s*\|\s*/) # use fields here... end James Edward Gray II