From: Xavier Noria Date: 2009-09-14T04:36:18+09:00 Subject: Re: normalizing newlines On Sun, Sep 13, 2009 at 9:15 PM, Alan Munn wrote: > I'm not sure I know exactly what you mean. The script takes copied cells > in csv format and massages them into different LaTeX table styles for > insertion into a LaTeX document.  I first split the lines and then use > csv methods to do the rest. I mean, do you have the entire CSV in memory? I guess the split means you do. In that case you could split with a regexp like this: lines = csv.split(/[\015\012]+/) The exact regexp depends on what you need. That one prevents blank items in lines in particular, may do. That said, I'd normally use a CSV library to handle the input.