users-prolog
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

read from file


From: OMERK
Subject: read from file
Date: Tue, 15 Aug 2006 11:54:35 +0300

 
hi,
 
i want to read data from the file (data.txt). and want to use these prolog predicate like
a(book)
a(computer)
a(phone)
a(pen)
a(pencil)
 
i have two file. "file.pl" and "data.txt"
                                      
file.pl  like this. 
 
 
a(T):-see('file.pl'), repeat,
read_atom(T) , ( T=end_of_file -> true,! ;fail ), seen.
 
or
 
a(T):-open('file.pl',read,S),
 read_atom(S,T) , ( T= at_end_of_stream -> true ; read_atom(S,T), fail ), close(S).
 
 
 
i try but i couldn't. how should  be a correct true "file.pl"   file.
 
 
 
 
   ________________________________________________________________________________
 
   ömer külahcı
 
   türk hava yolları a.o. genel müdürlük binası, yatırım yönetimi başkanlığı AR-GE müdürlüğü, 10. kat   
   34149 yeşilköy / istanbul    tel: (212) 463 63 63 / 2096   fax: (212) 465 20 97
   turkish airlines inc. general management building, dir. investment management, mng. research & development, floor 10    
   34149 yeşilköy / istanbul / turkey    phone: (+90 212) 463 63 63 / 2096   fax: (+90 212) 465 20 97
  


============================================================================================

Bu e-mail mesaji ve ekleri, isimleri yazili alicilar disindaki kisilere aciklanmamasi, dagitilmamasi ve iletilmemesi gereken kisiye ozel ve gizli bilgiler icerebilir. Mesajin muhatabi degilseniz lutfen gonderici ile irtibat kurunuz, mesaj ve eklerini siliniz. E-mail sistemlerinin tasidigi guvenlik risklerinden dolayi, mesajlarin gizlilikleri ve butunlukleri bozulabilir, mesaj virus icerebilir. Bilinen viruslere karsi kontrolleri yapilmis olarak yollanan mesajin sisteminizde yaratabilecegi olasi zararlardan Sirketimiz (T.H.Y. A.O.) sorumlu tutulamaz.

This email and its attachments may contain private and confidential information intended for the use of the addressee only, which should not be announced, copied or forwarded. If you are not the intended recipient, please contact the sender, delete the message and its attachments. Due to security risks of email systems, the confidentiality and integrity of the message may be damaged, the message may contain viruses. This message is scanned for known viruses and our Company (Turkish Airlines Inc.) will not be liable for possible system damages caused by the message.

Attachment: data.txt
Description: data.txt


reply via email to

[Prev in Thread] Current Thread [Next in Thread]