CR vs LF in files - how to keep original chars when importing

Mark Schonewille m.schonewille at economy-x-talk.com
Wed Mar 23 15:23:45 EDT 2011


Metro,

function readFile theFile
  open file theFile for binary read
  read from file theFile until EOF
  close file theFile
  return it
end readFile

function readFile2 theFile
  return url ("binfile:" & theFile)
end readFile2

Mind the parentheses in the second example.

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
KvK: 50277553

New: Download the Installer Maker Plugin 1.6 for LiveCode here http://qery.us/ce

On 23 mrt 2011, at 19:58, Metro wrote:

> Hi:
> 
> What is the recommended way of importing text files in which CRs are
> used as record delimiters and LFs are used as cell delimiters within
> each paragraph? I'm using Mac 10.5 and LiveCode 4.5 (upgrading to 4.6
> later today)? Both of these, CR and LF, are getting turned into LFs
> when I bring them in.
> 
> I want to bring this type of file into LiveCode, process it using the
> chunk functions, and then write it back out to file.
> 
> Thanks,
> 
> m
> 






More information about the use-livecode mailing list