Skip to content

The byLine operator is platform dependent and therefore a bit unreliable #35

Closed
@flyaruu

Description

@flyaruu

I'm parsing a CSV file, and the byLine considers the whole file one long line.
The problem seems to be that the file lines use only CR line ends. (I don't know where that file came from)

The code looks like this:
public static Observable byLine(Observable source) {
return split(source, System.getProperty("line.separator"));
}

Using the system property for line separator isn't a very good idea, I think. It works when the file originates from the same platform, but it is a bit of a bugger to debug, and it can cause a 'works on my system' scenario.

I'd say just use the split and get rid of the byLine? Or add an explicit separator parameter (but then it is identical to split)

regards, Frank

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions