To be perfectly honest, I'm not in the same league in terms of system programming skills as you core Julia developers. I suspect that any solution I come up with will not be sufficiently efficient or elegant. However, I will play around with this, and if I come up with a solution I think is reasonable, and if no one else offers a solution first, I'll submit a PR for review. In the meantime I filed an issue: #6108<https://github.com/JuliaLang/julia/issues/6108>
--Peter On Monday, March 10, 2014 5:31:03 PM UTC-7, Kevin Squire wrote: > > If you have time, why don't you give it a go at fixing this and submitting > a pull request? > > Kevin > > On Monday, March 10, 2014, Peter Simon <[email protected] <javascript:>> > wrote: > >> Just tried to grab the lines in a text file on Windows using Julia >> Version 0.3.0-prerelease+1570 with the following code: >> >> lines = open("test.cut","r") do fid >> readchomp(fid) >> end >> >> lines came back to be a single string with embeded "\r\n" characters. I >> had expected to get an array of strings without any trailing carriage >> returns/newlines. Looking in the Julia source code I see that only '\n' is >> checked for. >> >> I work in an environment where we freely intermix Linux-style >> ('\n'-terminated) and Windows-style ("\r\n"-terminated) files. Most of our >> other tools work transparently with either file type, without any explicit >> need for conversion. >> >> Are there any plans to make Julia's utility functions such as chomp(), >> readchomp(), etc., be able to handle these various line ending conventions? >> >> Thanks, >> --Peter >> >
