Getting text from an external file
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 14
- Joined: Mon Dec 15, 2014 4:51 am
Getting text from an external file
I have a file on an external server and when i post to it and retireive it with in my program it is not properly formatted depending on which platform I am using. If I post the file on my mac, the file reads as a single line when I retireive it and put it into a text field. When I use my PC, the text is properly formatted and shows up as it was in the initiallly. Why the difference on the two platforms. I want the text to stay as it was initially.
Re: Getting text from an external file
Hi,
I assume you don't mean "formatted" but "encoded": some characters of your text, including crlf, don't show up correctly. What is the encoding of your file?
Kind regards,
Mark
I assume you don't mean "formatted" but "encoded": some characters of your text, including crlf, don't show up correctly. What is the encoding of your file?
Kind regards,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
-
- Posts: 14
- Joined: Mon Dec 15, 2014 4:51 am
Re: Getting text from an external file
what i mean is that when i upload with my mac and retrieve the data in another stack it is all one line of text.
ie. 56 45 23 67
I have to reformat the data so that word 1 is put into line 1 etc.
When i upload with my PC and then retrieve the data in another stack it appear as I need it.
56
45
23
67
It is a lot easier if the data shows up as separate lines as it is the field that I am taking the data out of originally.
I hope this makes sense.
ie. 56 45 23 67
I have to reformat the data so that word 1 is put into line 1 etc.
When i upload with my PC and then retrieve the data in another stack it appear as I need it.
56
45
23
67
It is a lot easier if the data shows up as separate lines as it is the field that I am taking the data out of originally.
I hope this makes sense.
-
- VIP Livecode Opensource Backer
- Posts: 9842
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Getting text from an external file
The default text mode for read/write will alter line endings to account for platform-specific differences. Try the binary form instead.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn