From: Phil Swazey Date: 2009-04-29T13:13:49+09:00 Subject: FCSV importing file to Excel 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 C:/ruby/lib/ruby/gems/1.8/gems/fastercsv-1.2.3/lib/faster_csv.rb:1512:in `loop' from C:/ruby/lib/ruby/gems/1.8/gems/fastercsv-1.2.3/lib/faster_csv.rb:1512:in `shift' from C:/ruby/lib/ruby/gems/1.8/gems/fastercsv-1.2.3/lib/faster_csv.rb:1457:in `each' from C:/ruby/lib/ruby/gems/1.8/gems/fastercsv-1.2.3/lib/faster_csv.rb:1003:in `foreach' from C:/ruby/lib/ruby/gems/1.8/gems/fastercsv-1.2.3/lib/faster_csv.rb:1175:in `open' from C:/ruby/lib/ruby/gems/1.8/gems/fastercsv-1.2.3/lib/faster_csv.rb:1002:in `foreach' I've looked around and can't seem to find anyone that has any suggestions to get around this issue in FCSV. Anyone have any suggestions. Here is how I process the data from the csv file: # Open the csv data file being used to input the data to the Excel Template # Set the Column index to "A" this resets the colmn to "A" for each new # line in the data file. file_in = FCSV.foreach(file_excel_input) do |line| col_index = 'a' line_index += 1 #Index to the Active line where data will be Input in the Excel file #Get the line with an index number for the file the index was for the colmn #cell number but used a col_index instead. line.each_with_index do |element,i| #Put the data into the Spread sheet here!! begin worksheet.Range("#{col_index}#{line_index}")['Value'] = ["#{element}"] Greatly Appreciate any help or suggestions, I am relatively new to Ruby and programming. Thanks in Advance. -- Posted via http://www.ruby-forum.com/.