java - Is there a FilterInputStream to convert \r to the local system newline? -


i 1 of developers on platform that, among other features, allows users upload data files (from disparate sources) processing various scripts.

an issue keeps popping tab-separated data files excel mac. excel mac (even os x) ends lines cr characters (\r); linux (and modern mac) standard lf (\n). (windows cr lf, aka \r\n.) scripts run on linux machine, absolutely fail identify single \r characters line terminators.

on backend, we're feeding inputstream jcr node via usual api. i'd filterinputstream line feed conversion us. it's not code write ourselves, that's obvious cases; if there's canned library this, we'd prefer it, on grounds other people have worked out edge conditions us.

is there open-source library converts pretty of standard line-feed formats lf (or system line feed character) inside filterinputstream or other inputstream? few google searches didn't turn obvious, i'd astonished if there isn't something.

if there isn't, edge conditions shoot me in foot writing this?

use bufferedreader.readline(). parse , remove whatever line terminators present. when writing each line end, append whatever line terminator like.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -