<div dir="ltr">Chris, Lou,<div>Thanks. After more research on the web, I think I need to rethink my approach to the problem.  ""<span style="color:rgb(0,0,0);font-family:"Times New Roman";font-size:medium"> </span><span style="color:rgb(0,0,0);font-family:"Times New Roman";font-size:medium">PDF's are actually designed to be read "backwards" starting at the end.</span><span style="color:rgb(0,0,0);font-family:"Times New Roman";font-size:medium"> "" </span> My question is still valid  and I am working on a solution. Will post something if it is useful.</div><div><br></div><div>-jrm</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jul 24, 2017 at 5:25 PM, Chris Cunningham <span dir="ltr"><<a href="mailto:cunningham.cb@gmail.com" target="_blank">cunningham.cb@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi JRM, <div><br></div><div>I think MultiByteFileStream is where you want to work on this.  Since you said it is, specifically, a file that has Cr/Lf line endings, then this is the place.</div><div><br></div><div>There are tricks to making it work, which aren't clearly documented (unfortunately).  </div><div><br></div><div>This looks like how the MultiByteFileStream is supposed to work:</div><div><br></div><div>1. Open the file.</div><div>2. Send </div><div>          #wantsLineEndConversoin: true </div><div>    to the file.</div><div>3. Send #ascii to the file (to tell it is a text file, and to determine the Cr/Lf or Cr or Lf encoding)</div><div>4. Read data from file. It should convert Cr/Lf to just Cr, and all things are happy.</div><div><br></div><div>Except if you send something like #next: 20, and the last character isn't a #Cr, then it looks like it would be buggy.</div><div>But, please try this and see if it works.  If so, please let me know.</div><div><br></div><div>An alternative seems to be that you could just open it without any of those changes, and go through the file line by line (sending #nextLine to the file), and the implementation of #nextLine in PositionableStream should also take care of the Cr/Lf issues.</div><div><br></div><div>If you try this route, please let me know how it goes as well.</div><div><br></div><div>Thanks,</div><div>cbc</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Mon, Jul 24, 2017 at 11:00 AM, John-Reed Maffeo <span dir="ltr"><<a href="mailto:jrmaffeo@gmail.com" target="_blank">jrmaffeo@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr">Is there an existing method that will tokenize/chunk(?) data from a file using  CR/LF? The use case is to decompose a file into PDF objects defined as strings are strings terminated by CR/LF. (if there is an existing framework/project available, I have not found it, just dead ends :-(<div><br></div><div><div>I have been exploring in #String and #ByteString and this is all I have found that is close to what I need.</div><div><br></div><div>"Finds first occurance of #Sting"</div><div>self findString: ( Character cr  asString,  Character lf asString).</div><div>"Breaks at either token value"</div><div>self findTokens: ( Character cr  asString,  Character lf asString)</div></div><div><br></div><div>I have tried poking around in #MultiByteFileStream, but  keep running into errors.</div><div><br></div><div>If there is no existing method, any suggestions how to write a new one? My naive approach is to scan for CR and then peek for LF keeping track of my pointers and using them to identify the CR/LF delimited substrings; or iterate through contents using #findString:<br></div><div><br></div><div>TIA, jrm</div><div><br></div><div>-----</div><div><div>Image</div><div>-----</div><div>C:\Smalltalk\Squeak5.1-16549-6<wbr>4bit-201608180858-Windows\Sque<wbr>ak5.1-16549-64bit-201608180858<wbr>-Windows\Squeak5.1-16549-<wbr>64bit.1.image</div><div>Squeak5.1</div><div>latest update: #16549</div><div>Current Change Set: PDFPlayground</div><div>Image format 68021 (64 bit)</div><div><br></div><div>Operating System Details</div><div>------------------------</div><div>Operating System: Windows 7 Professional (Build 7601 Service Pack 1)</div><div><span style="white-space:pre-wrap">   </span>Registered Owner: T530</div><div><span style="white-space:pre-wrap">   </span>Registered Company: </div><div><span style="white-space:pre-wrap">    </span>SP major version: 1</div><div><span style="white-space:pre-wrap">      </span>SP minor version: 0</div><div><span style="white-space:pre-wrap">      </span>Suite mask: 100</div><div><span style="white-space:pre-wrap">  </span>Product type: 1</div></div><div><br></div></div>
<br></div></div><span class="">______________________________<wbr>_________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@lists.squeakfoundation.org" target="_blank">Beginners@lists.squeakfoundati<wbr>on.org</a><br>
<a href="http://lists.squeakfoundation.org/mailman/listinfo/beginners" rel="noreferrer" target="_blank">http://lists.squeakfoundation.<wbr>org/mailman/listinfo/beginners</a><br>
<br></span></blockquote></div><br></div>
<br>______________________________<wbr>_________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@lists.squeakfoundation.org">Beginners@lists.<wbr>squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/mailman/listinfo/beginners" rel="noreferrer" target="_blank">http://lists.squeakfoundation.<wbr>org/mailman/listinfo/beginners</a><br>
<br></blockquote></div><br></div>