This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.
For more information, see this announcement post . Click the X in the top right-corner of this box to dismiss this message.
Old posts that have not been replied to for several years.
e
erman
Post
by erman » Sun Sep 19, 2004 3:22 am
hello...
can anyone tell me example how i can read file from txt...i would like to make it read LAST LINE from TXT file...
ok let say the content in txt is like :
info
1
2
3
4
5
6
lastline
so how i can make the tcl only get the line that reside at LAST LINE.
thanks
]Kami[
Owner
Posts: 590 Joined: Thu Jul 24, 2003 2:59 pm
Location: Slovenia
Contact:
Post
by ]Kami[ » Sun Sep 19, 2004 6:39 am
This should help you a bit
e
erman
Post
by erman » Sun Sep 19, 2004 7:23 am
no it not help...
any other expert can help me..
thx.
awyeah
Revered One
Posts: 1580 Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:
Post
by awyeah » Sun Sep 19, 2004 8:56 am
I would say:
1. Open the file.
2. Split the data into lines.
3. Check how many lines are in the file.
4. Minus one from the total number of lines as index starts from 0.
5. Go and read the lastline from the split data.
or
You can use EOF with a while loop.
·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
YooHoo
Owner
Posts: 939 Joined: Thu Feb 13, 2003 10:07 pm
Location: Redwood Coast
Post
by YooHoo » Sun Sep 19, 2004 1:24 pm
erman wrote: hello...
can anyone tell me example how i can read file from txt...i would like to make it read LAST LINE from TXT file...
...so how i can make the tcl only get the line that reside at LAST LINE.
thanks
read
this tcl tutorial .
Ofloo
Owner
Posts: 953 Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:
Post
by Ofloo » Thu Sep 23, 2004 8:26 am
there is a simular post i asked a while back check the forum
XplaiN but think of me as stupid