From: Alan Munn Date: 2009-09-14T08:30:05+09:00 Subject: Re: normalizing newlines In article <31a130740909131235td77a0bcq411701614be25ce7@mail.gmail.com>, Xavier Noria wrote: > 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. Yes, this will do what I want. > > That said, I'd normally use a CSV library to handle the input. Well the basic idea is to simply allow cut and paste functionality from a spreadsheet to a LaTeX document, so I'm never dealing with huge amounts of data generally. Thanks for the help. Alan