J
Junkone
When i try to parse this file, i get a error.
irb(main):006:0> rows=FasterCSV.new("c:\\temp\\mktsymbols.txt",
{:headers=>true,:
col_sep=>"\t"})
=> #<FasterCSV:0x2ddfc3c @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:
0x2ddfc00>, @quote=
#<Proc:0x02e05f90@e:/ruby/lib/ruby/gems/1.8/gems/fastercsv-1.2.1/lib/
faster_csv.
rb:1665>, @quote_char="\"">
the file contents are
SYMBOL DESCRIPTION EXCHANGE
EDS RX EDS JUN 2008 P 22.500 OPRA
EDS RY EDS JUN 2008 P 27.500 OPRA
EDS RZ EDS JUN 2008 P 32.500 OPRA
EDS XD EDS DEC 2007 P 20.000 OPRA
EDS XE EDS DEC 2007 P 25.000 OPRA
EDS XF EDS DEC 2007 P 30.000 OPRA
EDS XG EDS DEC 2007 P 35.000 OPRA
EDS XH EDS DEC 2007 P 40.000 OPRA
EDS XT EDS DEC 2007 P 17.500 OPRA
EDS XU EDS DEC 2007 P 37.500 OPRA
EDS XX EDS DEC 2007 P 22.500 OPRA
EDS XY EDS DEC 2007 P 27.500 OPRA
EDS XZ EDS DEC 2007 P 32.500 OPRA
EDS1CN07 EDS JUL 2007 ONECH
EDS1CQ07 EDS AUG 2007 ONECH
EDS1CU07 EDS SEP 2007 ONECH
EDS1CZ07 EDS DEC 2007 ONECH
EDSAX EVERGREEN DISCIPLINED VALUE FUND CLASS NASDAQ
EDSBX EVERGREEN DISCIPLINED VALUE FUND CLASS NASDAQ
EDSCX EVERGREEN DISCIPLINED VALUE FUND CLASS NASDAQ
EDSI EDUCATIONAL SERVICES OTC
EDSIX EVERGREEN DISCIPLINED VALUE FUND INSTI NASDAQ
EDTA E-DATA CORPORATION OTC
EDTDF ENEA AB OTC
EDTXX EVERGREEN INSTI TREASURY MONEY MARKET F NASDAQ
irb(main):006:0> rows=FasterCSV.new("c:\\temp\\mktsymbols.txt",
{:headers=>true,:
col_sep=>"\t"})
=> #<FasterCSV:0x2ddfc3c @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:
0x2ddfc00>, @quote=
#<Proc:0x02e05f90@e:/ruby/lib/ruby/gems/1.8/gems/fastercsv-1.2.1/lib/
faster_csv.
rb:1665>, @quote_char="\"">
the file contents are
SYMBOL DESCRIPTION EXCHANGE
EDS RX EDS JUN 2008 P 22.500 OPRA
EDS RY EDS JUN 2008 P 27.500 OPRA
EDS RZ EDS JUN 2008 P 32.500 OPRA
EDS XD EDS DEC 2007 P 20.000 OPRA
EDS XE EDS DEC 2007 P 25.000 OPRA
EDS XF EDS DEC 2007 P 30.000 OPRA
EDS XG EDS DEC 2007 P 35.000 OPRA
EDS XH EDS DEC 2007 P 40.000 OPRA
EDS XT EDS DEC 2007 P 17.500 OPRA
EDS XU EDS DEC 2007 P 37.500 OPRA
EDS XX EDS DEC 2007 P 22.500 OPRA
EDS XY EDS DEC 2007 P 27.500 OPRA
EDS XZ EDS DEC 2007 P 32.500 OPRA
EDS1CN07 EDS JUL 2007 ONECH
EDS1CQ07 EDS AUG 2007 ONECH
EDS1CU07 EDS SEP 2007 ONECH
EDS1CZ07 EDS DEC 2007 ONECH
EDSAX EVERGREEN DISCIPLINED VALUE FUND CLASS NASDAQ
EDSBX EVERGREEN DISCIPLINED VALUE FUND CLASS NASDAQ
EDSCX EVERGREEN DISCIPLINED VALUE FUND CLASS NASDAQ
EDSI EDUCATIONAL SERVICES OTC
EDSIX EVERGREEN DISCIPLINED VALUE FUND INSTI NASDAQ
EDTA E-DATA CORPORATION OTC
EDTDF ENEA AB OTC
EDTXX EVERGREEN INSTI TREASURY MONEY MARKET F NASDAQ