Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6744813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:07:43+00:00 2026-05-26T12:07:43+00:00

Newbie to ruby this is my first project I am using the FasterCSV Gem

  • 0

Newbie to ruby this is my first project I am using the FasterCSV Gem and absolutely love the speed.

I have found one problem that when a field is too long it throws up an error below:

/Library/Ruby/Gems/1.8/gems/fastercsv-1.5.4/lib/faster_csv.rb:1641:in `shift’: FasterCSV::MalformedCSVError (FasterCSV::MalformedCSVError)

The error is on the second line first line is read correctly 🙂

“1013197145”,”PSION HU6020 Hand Strap”,”1″,”1″,”10″

“1013197542”,”HP ProBook NA920EA_KT931AT 39.6 cm (15.6″) Notebook – Intel Core 2 Duo T6570 2.10 GHz – 1366 x 768 WXGA Display – 2 GB RAM – 250 GB HDD – DVD-Writer LightScribe – Intel GMA 4500MHD Graphics Card – Bluetooth – Webcam – Genuine Windows Vista Business – 5 Hour Battery – HDMI”,”1″,”1″,”10″

here is my code:

FasterCSV.foreach(file_path, {:col_sep=> colsep, :quote_char => char}) do |row|

   my.query("INSERT INTO product_prices (partno,costpriceexvat,sku, supplierid) VALUES ('#{row[7]}', '#{row[8]}', '#{row[3]}','1')")

end

any help would be much appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T12:07:44+00:00Added an answer on May 26, 2026 at 12:07 pm

    I suspect this has nothing to do whatsoever with FasterCSV choking on long strings and everything with the inch character in the “(15.6″)” part of your item description – as it is identical to the quote, it terminates the CSV value, thus making for a malformed CSV line. FasterCSV is designed to be strict about this kind of things.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm a newbie to Ruby, I have a problem following the Poignant Guide to
I am newbie in ruby and regular expressions and I have this function write
I am newbie in Ruby.. seeking some help.. I have a code DB =
I'm definitely a newbie to ruby (and using 1.9.1), so any help is appreciated.
Is is that I'm a newbie learning Ruby, or does it really have more
I'm a newbie ruby on rails programmer, so forgive me if this is a
I am a newbie to Ruby and am learning it using Programming Ruby 1.9
I am a Rails Newbie. I am using fb_graph gem to extract information. Rails
I'm a complete newbie in ruby but I can feel that this code can
I'm newbie on both ruby and linux, so I'm sure this is trivial but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.