From: James Gray Date: 2009-04-29T21:46:20+09:00 Subject: Re: FCSV importing file to Excel On Apr 28, 2009, at 11:13 PM, Phil Swazey wrote: > I have a csv file that I am inputting into an excel spreadsheet. One > of > the fields is a hyperlink: > =HYPERLINK("http://www.radiofreetexas.org/","ClickHere") > > When FCSV comes across the file to process it and insert pass the data > to be inserted into the Excel file I get an error: > C:/ruby/lib/ruby/gems/1.8/gems/fastercsv-1.2.3/lib/faster_csv.rb: > 1592:in > `shift': Unclosed quoted field on line 1. > (FasterCSV::MalformedCSVError) > from FasterCSV is complaining that your data isn't valid CSV data. If you showed the entire field above, that's true. In CSV, a field that contains commas or quotes must be enclosed in quotes ad have the inner quotes escaped. Thus, to be valid the above field should be: "=HYPERLINK(""http://www.radiofreetexas.org/"", ""ClickHere"")" Unfortunately, I can't think of an easy way to break up data like that. You would likely need to build your own parser to handle it. Sorry I wasn't more help. James Edward Gray II