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.

read file TXT

Old posts that have not been replied to for several years.
Locked
e
erman

read file TXT

Post by erman »

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
User avatar
]Kami[
Owner
Posts: 590
Joined: Thu Jul 24, 2003 2:59 pm
Location: Slovenia
Contact:

Post by ]Kami[ »

This should help you a bit :)
e
erman

Post by erman »

no it not help...

any other expert can help me..

thx.
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

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.
==================================
User avatar
YooHoo
Owner
Posts: 939
Joined: Thu Feb 13, 2003 10:07 pm
Location: Redwood Coast

Re: read file TXT

Post by YooHoo »

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.
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

there is a simular post i asked a while back check the forum
XplaiN but think of me as stupid
Locked