how to merge strings to a line

andy king indiankid at gmail.com
Fri Feb 2 19:33:28 EST 2007


Hello,

I have a file that contains the following:

<snip>

my name is larry
is in 10th grade
got A+ in math

my name is john
is in 10th grade
got A+ in english

my name is peter
[...]

</snip>

i need to convert the file to look like:
<snip>

my name is larry
my name is larry is in 10th grade   --> (my name is larry is common and
needs to be prepend to the string.
my name is larry got A+ in match
my name is larry i am good  --> (this is an addition)

my name is john
my name is john is in 10th grade
my name is john got A+ in english
my name is john i am good

<snip>

I would really appreciate if someone could help me out with the logic here.
any tips/direction would be helpful.

-- 
--andy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20070202/353ed0a5/attachment.html>


More information about the Python-list mailing list