Junkone
12/7/2007 8:51:00 PM
On Dec 7, 3:24 pm, James Gray <ja...@grayproductions.net> wrote:
> On Dec 7, 2007, at 12:30 PM, Junkone wrote:
>
> > When i try to parse this file, i get a error.
>
> Can you show the error please?
>
> James Edward Gray II
when i try to print the row, it returns nil. pl see below. it means
that this tool could not parse the data.
irb(main):045:0> rows=FasterCSV.new("c:\\temp\\mktsymbols.txt",
{:headers=>true,:
col_sep=>"\t"})
=> #<FasterCSV:0x2e38378 @lineno=0, @header_converters=[],
@converters=[], @unco
nverted_fields=nil, @parsers={:line_end=>/\n\z/, :leading_fields=>/
\A(?:\t)+/, :
csv_row=>/ \G(?:^|\t) # anchor the match
(?: "( (?>[^"]*) # find quoted fields
(?> ""
[^"]* )* )"
| # ... or ...
([^"\t]*) # unquoted fields
)/x}, @row_sep="\n", @return_headers=false,
@headers=nil, @col_sep
="\t", @use_headers=true, @skip_blanks=false, @io=#<StringIO:
0x2e3833c>, @quote=
#<Proc:0x02e05f90@e:/ruby/lib/ruby/gems/1.8/gems/fastercsv-1.2.1/lib/
faster_csv.
rb:1665>, @quote_char="\"">
irb(main):047:0> rows.each{|r| puts "row found"}
=> nil
irb(main):047:0>