Read a text file

Frank D. Engel, Jr. fde101 at fjrhome.net
Mon Jan 17 17:32:34 EST 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

hmm, minor improvements (and to kill off the quotes):

put URL "file:Stories/Westwind" into vArr
repeat for each line x in vArr   -- faster than with i= notation
   -- separate fields
   put item 1 of x into vName
   put item 2 of x into vID
   put item 3 of x into vMail

   -- delete quotes
   delete char 1 of vName
   delete char 1 of vID
   delete char 1 of vMail
   delete the last char of vName
   delete the last char of vID
   delete the last char of vMail

   -- place into fields: note this will only result in the last line of 
the file being in the fields, since
   -- it replaces the former contents each time.  modify as needed to 
fix this

   put vName into field "Name"
   put vID into field "ID"
   put vMail into field "Email address"
end repeat

On Jan 17, 2005, at 5:21 PM, Thomas Gutzmann wrote:

>> How do I read a text file then insert the information in a label?
>>
>> Text file format will be:
>>
>> "Name","ID","Email at Address.net"
>>
>> There will be 3 labels "Name", "ID", and "Email address"
>
> set the itemDelimiter to "," -- this is the default
> put URL "file:Stories/Westwind" into vArr
> repeat with i = 1 to the number of lines in vArr
>   put item 1 of line i of vArr into vName
>   put item 2 of line i of vArr into vID
>   put item 3 of line i of vArr into vEMail
> end repeat
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>
- -----------------------------------------------------------
Frank D. Engel, Jr.  <fde101 at fjrhome.net>

$ ln -s /usr/share/kjvbible /usr/manual
$ true | cat /usr/manual | grep "John 3:16"
John 3:16 For God so loved the world, that he gave his only begotten 
Son, that whosoever believeth in him should not perish, but have 
everlasting life.
$
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)

iD8DBQFB7D0E7aqtWrR9cZoRAhSQAJ0U1ceRaFiU2Nx2oK8bXu0OD5UKoACeKng9
4PTZHPAjOIzi7Y4ZXGCQ774=
=zKUx
-----END PGP SIGNATURE-----



___________________________________________________________
$0 Web Hosting with up to 120MB web space, 1000 MB Transfer
10 Personalized POP and Web E-mail Accounts, and much more.
Signup at www.doteasy.com



More information about the use-livecode mailing list