From: Chad Perrin Date: 2012-01-10T07:52:27+09:00 Subject: Re: Stripping double quotes On Tue, Jan 10, 2012 at 07:31:11AM +0900, Mickey Vogel wrote: > Hi, > > I have the attached file, but my issue is that the file I am parsing, is > in this format: > > "45hc43j","sdfsdf","","Dead","sdfdsf ","sgfsdf","","sdfg","null","", > > That is why I escape quotes in the script. How do I get an output that > doesn't have double quotes? I tried using gsub but it was of no use. How is gsub no use? $ irb >> string = '"45hc43j","sdfsdf","","Dead","sdfdsf ","sgfsdf","","sdfg","null","",' => "\"45hc43j\",\"sdfsdf\",\"\",\"Dead\",\"sdfdsf \",\"sgfsdf\",\"\",\"sdfg\",\"null\",\"\"," >> new_string = string.gsub('"', '') => "45hc43j,sdfsdf,,Dead,sdfdsf ,sgfsdf,,sdfg,null,," That seems to work just fine for me. -- Chad Perrin [ original content licensed OWL: http://owl.apotheon.org ]