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
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
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
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...@
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
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/