CR vs LF in files - how to keep original chars when importing
stephen barncard
stephenREVOLUTION2 at barncard.com
Wed Mar 23 15:43:31 EDT 2011
the salient point being that when you open a file for read BINARY, you get
exactly what's in the file, and Livecode does not interpret your line
endings. Otherwise line endings in text reads get changed to whatever
platform the user is using.
On 23 March 2011 12:23, Mark Schonewille
<m.schonewille at economy-x-talk.com>wrote:
> 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
> >
>
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
--
Stephen Barncard
San Francisco Ca. USA
more about sqb <http://www.google.com/profiles/sbarncar>
More information about the use-livecode
mailing list