Sorry, missed the [NF} aspect. Figured anyone posting here still had access to VFP, though. If not, you really should. ;)
Fred On Thu, Dec 1, 2011 at 12:36 PM, Jarvis, Matthew <[email protected]> wrote: > > -----Original Message----- > > From: [email protected] > [mailto:[email protected]] > > On Behalf Of Fred Taylor > > Sent: Thursday, December 01, 2011 11:29 AM > > To: [email protected] > > Subject: Re: [NF] control char makes text file FUBAR > > > > FILETOSTR() does not care about ^Z. It doesn't stop there. > > > > Fred > > > I'm afraid I don't have VFP as a tool anymore... > > FileToStr would have been my first choice.... > > I dug this up on a web site when I figured out how to phrase the > question in a way that generated a good hit... Needed to open so called > 'text' file as a binary... > > -------------------------------- > > Dim search As String > search = chr(26) (I removed the actual char in case it messed up > everyone's email with a control code in here) > Dim repl As String > repl = " " > Dim text As String > Dim arr As Variant > Dim line As String > Dim item As Variant > Open strFileName For Binary Access Read Lock Read As #1 > text = Input$(LOF(1), #1) > Close #1 > > arr = Split(text, vbNewLine) > > Open strFileName2 For Output As #2 '<--temporary file > > For Each item In arr > > line = Replace(CStr(item), search, repl, 1, -1) > Print #2, line > > Next > > Close #2 > > -------------------------------- > > > > Thanks, > > Matthew Jarvis || Business Systems Analyst > IT Department > McKenzie-Willamette Medical Center > 1460 G Street, Springfield, OR 97477 || Ph: 541-744-6092 || Fax: > 541-744-6145 > -------------------------------------------------------------------------- > Disclaimer: This electronic message may contain information that is > Proprietary, Confidential, or legally privileged or protected. It > is intended only for the use of the individual(s) and entity named > in the message. If you are not an intended recipient of this > message, please notify the sender immediately and delete the > material from your computer. Do not deliver, distribute or copy > this message and do not disclose its contents or take any action in > reliance on the information it contains. > [excessive quoting removed by server] _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/CAJCBksre93r=wAHAP=8Q=QFXfQu2cP=lr1jowqqqejnrhhf...@mail.gmail.com ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

