AnsweredAssumed Answered

vrf Read last line for a (long) text file

Question asked by VRFuser on Jun 9, 2006
Gianfranco,

I think you have to read the entire file to get the information about the last line.

Try this and I use this before.

1.  Read the entire file by reading each line and put into an array of lines.

2.  Determine the maximum of the array

3.  Extract the last array of string for the last line.

This can be use for any file size? That the benefit...

Han

-----Original Message-----
From: G. Durin [mailto:durin@ien.it]
Sent: Friday, June 09, 2006 7:43 AM
To: VRF
Subject: [vrf] Read last line for a (long) text file

Hi all,
is there anyone who has a good idea to read the very last line of a text file without reading all the lines?
A sort of the equivalent linux-command 'tail', which to my knowledge has no equivalent in dos.

Many thanks for your help

Regards,
Gianfranco
------------------------------------------------------------------
Istituto Nazionale di Ricerca Metrologica (I.N.Ri.M) (former Istituto Elettrotecnico Nazionale Galileo Ferraris) Strada delle Cacce, 91 - 10135 Torino Italy
tel: ++39 011 3919839    fax: ++39 011 3919834
Personal home page: http://www.inrim.it/~durin/ INRiM home pag: http://www.inrim.it/ =============================================================
Please note my new e-mail: durin@inrim.it =============================================================

---
You are currently subscribed to vrf as: Han.Tran@wdc.com To subscribe please send an email to: "vrf-request@lists.it.agilent.com"
with the word subscribe in the message body.
To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".
To send messages to this mailing list,  email "vrf@agilent.com". 
If you need help with the mailing list send a message to "owner-vrf@it.lists.it.agilent.com".
Search the "unofficial vrf archive" at "www.oswegosw.com/vrf_archive/".


---
To subscribe please send an email to: "vrf-request@lists.it.agilent.com" with the word subscribe in the message body.
To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".
To send messages to this mailing list,  email "vrf@agilent.com". 
If you need help with the mailing list send a message to "owner-vrf@it.lists.it.agilent.com".
Search the "unofficial vrf archive" at "www.oswegosw.com/vrf_archive/".

Outcomes