<br>This is the sort of thing I wrote bufsock for. Don't let the name fool you - although I originally wrote it for sockets, it's since been extended to work with files and file handles.<br><br><a href="http://stromberg.dnsalias.org/~dstromberg/bufsock.html">http://stromberg.dnsalias.org/~dstromberg/bufsock.html</a><br>
<br>It was recently modified to work on 2.x and 3.x.<br><br><div class="gmail_quote">On Thu, Aug 11, 2011 at 7:03 PM, goldtech <span dir="ltr"><<a href="mailto:goldtech@worldpost.com">goldtech@worldpost.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi,<br>
<br>
Say I have a very big string with a pattern like:<br>
<br>
akakksssk3dhdhdhdbddb3dkdkdkddk3dmdmdmd3dkdkdkdk3asnsn.....<br>
<br>
I want to split the sting into separate parts on the "3" and process<br>
each part separately. I might run into memory limitations if I use<br>
"split" and get a big array(?) I wondered if there's a way I could<br>
read (stream?) the string from start to finish and read what's<br>
delimited by the "3" into a variable, process the smaller string<br>
variable then append/build a new string with the processed data?<br>
<br>
Would I loop it and read it char by char till a "3"...? Or?<br>
<br>
Thanks.<br>
<font color="#888888">--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</font></blockquote></div><br>