Skip to content

Error on last colum CSV parser #6

Description

@GoogleCodeExporter
Using the following CSV

date as date,price1 as number,price2 as number
1263513600,1.01639745219793,0.97529044635285
1262736000,1.01946578978044,1.00637294052746

The last column is get as "price2 as number\r" and the regular expression that 
identify the type, fails

if (preg_match('/^(.*) as 
(date|datetime|boolean|timeofday|number)$/',$id,$matches)) {

Works for me using trim.

if (preg_match('/^(.*) as 
(date|datetime|boolean|timeofday|number)$/',trim($id),$matches)) {

Original issue reported on code.google.com by carlos.g...@gmail.com on 2 Jan 2011 at 3:06

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions