Suggestions for how to approach this problem?

Marc 'BlackJack' Rintsch bj_666 at gmx.net
Tue May 8 15:37:38 EDT 2007


In <4640ca5b$0$23392$c3e8da3 at news.astraweb.com>, John Salerno wrote:

> I have a large list of publication citations that are numbered. The 
> numbers are simply typed in with the rest of the text. What I want to do 
> is remove the numbers and then put bullets instead. Now, this alone 
> would be easy enough, with a little Python and a little work by hand, 
> but the real issue is that because of the way these citations were 
> typed, there are often line breaks at the end of each line -- in other 
> words, the person didn't just let the line flow to the next line, they 
> manually pressed Enter. So inserting bullets at this point would put a 
> bullet at each line break.
> 
> So I need to remove the line breaks too, but of course not *all* of them 
> because each reference still needs a line break between it. So I'm 
> hoping I could get an idea or two for approaching this. I figure regular 
> expressions will be needed, and maybe it would be good to remove the 
> line breaks first and *not* remove a line break that comes before the 
> numbers (because that would be the proper place for one), and then 
> finally remove the numbers.

I think I have vague idea how the input looks like, but it would be
helpful if you show some example input and wanted output.

Ciao,
	Marc 'BlackJack' Rintsch



More information about the Python-list mailing list