PRINT LAST ENTRY IN A FILE

2009-11-28 Thread raphael()
Hi, I want to print the last entry by record "" in this file "records.txt" The file is read in a subroutine and prints last line by the number in this example. # records.txt 25.11.2009 NAME_0 15.12.2006 NAME_3 20.10.2007 NAME_1 01.01.2008 NAME_3<-- This whole line sho

Re: PRINT LAST ENTRY IN A FILE

2009-11-28 Thread Dermot
2009/11/28 raphael() : > Hi, Hi, > # records.txt > 25.11.2009 NAME_0 > 15.12.2006 NAME_3 > 20.10.2007 NAME_1 > 01.01.2008 NAME_3    <-- This whole line should be printed. > 10.10.2008 NAME_4 > > Using while in a while loop matching ( m// ) I get all the entries > havin

Re: PRINT LAST ENTRY IN A FILE

2009-11-28 Thread Dermot
2009/11/28 raphael() : >> 2009/11/28 raphael() : >> > Hi, >> Hi, >> >> > # records.txt >> > 25.11.2009 NAME_0 >> > 15.12.2006 NAME_3 >> > 20.10.2007 NAME_1 >> > 01.01.2008 NAME_3    <-- This whole line should be printed. >> > 10.10.2008 NAME_4 >> > >> > Using while in a whi

Re: PRINT LAST ENTRY IN A FILE

2009-11-30 Thread Dr.Ruud
raphael() wrote: I want to print the last entry by record "" in this file "records.txt" grep ^ records.txt |tail -n1 perl -ne '$s=$_ if/^/}{print$s' records.txt -- Ruud -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@

Re: PRINT LAST ENTRY IN A FILE

2009-12-01 Thread matt
On Nov 28, 2:21 pm, paik...@googlemail.com (Dermot) wrote: > 2009/11/28 raphael() : > > > > >> 2009/11/28 raphael() : > >> > Hi, > >> Hi, > > >> > # records.txt > >> > 25.11.2009 NAME_0 > >> > 15.12.2006 NAME_3 > >> > 20.10.2007 NAME_1 > >> > 01.01.2008 NAME_3    <-- This whole

Re: PRINT LAST ENTRY IN A FILE

2009-12-02 Thread Dr.Ruud
matt wrote: my @hits = grep /$input/, ; quotemeta: my @hits = grep /\Q$input/, ; -- Ruud -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/