# FasterCSV question

**URL:** <https://www.ruby-forum.com/t/fastercsv-question/74988>\
**Category:** Ruby\
**Created:** [November 7, 2006, 11:05am UTC](https://www.ruby-forum.com/t/fastercsv-question/74988 "2006-11-07T11:05:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lycanthrope](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/a88e57/32.png) [@lycanthrope](https://www.ruby-forum.com/u/lycanthrope)\
**Post date:** [November 7, 2006, 11:05am UTC](https://www.ruby-forum.com/t/fastercsv-question/74988/1 "2006-11-07T11:05:15Z")

</div>

Given a pipe ‘|’ delimited file ala:  
rthompso@jhereg:~$ cat pipedata  
A|This is text|Is this supposed to error|  
A|This is text|Is this supposed to error|  
A|This is text|Is this supposed to error|  
A|This is text|Is this supposed to “error”|  
A|This is text|Is this supposed to “error”|  
A|This is text|Is this supposed to “error”|  
A|This is text|Is this supposed to “error”|  
A|This is text|Is this supposed to “error”|  
A|This is text|Is this supposed to “error”|  
A|This is text|Is this supposed to “error”|  
A|This is text|Is this supposed to “error”|  
A|This is text|Is this supposed to “error”|

and scripting ala:

rthompso@jhereg:~$ cat pipedata.rb  
require ‘rubygems’  
require ‘faster\_csv’

FasterCSV.foreach("/home/rthompso/pipedata", :col\_sep =\> ‘|’) do |row|  
# use row here…  
next if row.empty?  
puts row  
end

Why are rows that contain quoted data deemed MalFormed?

---

<div class="post-metadata">

**Author:** ![lycanthrope](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/a88e57/32.png) [@lycanthrope](https://www.ruby-forum.com/u/lycanthrope)\
**Post date:** [November 7, 2006, 11:05am UTC](https://www.ruby-forum.com/t/fastercsv-question/74988/2 "2006-11-07T11:05:20Z")

</div>

On Nov 5, 2006, at 8:19 PM, Reid T. wrote:

> A|This is text|Is this supposed to “error”|

This line is not a legal CSV format. To be correct it would need to be:

A|This is text|“Is this supposed to ““error”””|

Luckily, it’s a trivial format you shouldn’t need FasterCSV to  
parse. You can break it down with:

fields = line.split("|")

Hope that helps.

James Edward G. II
