Kindly help to separate my records from the file

2007-05-11 Thread Goksie
them. please assist. Goksie #!/usr/bin/perl use strict; use warnings; $/ = "\n\n"; # Specify the record separator as 2 new lines.. my $fn = 'detail-20070423_1.txt'; open my $fh, '<', $fn or die $!; my %h; while(<$fh>){ if(/^\s+$/){ s/^\s+$/=

Re: creating hash from scalar variable

2007-05-03 Thread Goksie
e is a >> fairly /unrecognisable/ pattern, and the maintainer may be stumped! >> >> Cheers, >> >> Rob >> > > yes... to apply my code to the actual file everything was printed okay.. using the code below... but i need to separate each entry so that when i

Re: creating hash from scalar variable

2007-04-30 Thread Goksie
y he wanted to, and > may actually > need them? > >>## do something with your key and value: >>print "Key is $k, Value is: $v\n"; >> >> } >> >> close $fh; >> >> >> Reading a file line by line is a fairly recognizable

creating hash from scalar variable

2007-04-29 Thread Goksie
hello, Can someone help me correct this code. if i print, it only print the first line. Goksie #!/usr/bin/perl use strict; my $test = 'NAS-IP-Address = 192.168.42.1 Quintum-NAS-Port = "0 0/0/c1dc2a26" NAS-Port-Type = Async User-Name = "192.168.42.8&qu

creating hash from scalar variable

2007-04-29 Thread Goksie
hello, Can someone help me correct this code. if i print, it only print the first line. Goksie #!/usr/bin/perl use strict; my $test = 'NAS-IP-Address = 192.168.42.1 Quintum-NAS-Port = "0 0/0/c1dc2a26" NAS-Port-Type = Async User-Name = "192.168.42.8&qu

Re: Date and time

2007-01-21 Thread Goksie
ot;day=$day\n"; > print "month=".($month+1)."\n"; > print "year=".($year+1900)."\n\n"; > print "hour=$hour\n"; > print "minute=$min\n"; > print "second=$sec\n\n"; > > use POSIX 'strftime'; my

Re: Regular Expression and file editing.

2006-12-27 Thread Goksie
Mumia W. wrote: > On 12/25/2006 11:51 AM, Goksie wrote: >> [...] >> If i run the script, the changes could not be effected bcos the files is >> a readonly file. >> >> I will be glad if someone can put me true >> >> goksie >> > > You

Regular Expression and file editing.

2006-12-25 Thread Goksie
I will be glad if someone can give me a guide. I have a file test.conf [$ip] name=goksie host=$ip directive=ask configdir="/usr/local/etc/" now to disable this account I just have to remove the change the value of the ip however, I have tried this code it does not help. #!perl us

Re: Opening .dat file in perl

2006-10-30 Thread Goksie
John W. Krahn wrote: > Goksie wrote: > >> Tommy Nordgren wrote: >> >>> On 20 okt 2006, at 21.31, Goke Aruna wrote: >>> >>> >>>> On 10/20/06, John W. Krahn <[EMAIL PROTECTED]> wrote: >>>> >>

Re: Opening .dat file in perl

2006-10-24 Thread Goksie
Tommy Nordgren wrote: > > On 20 okt 2006, at 21.31, Goke Aruna wrote: > >> On 10/20/06, John W. Krahn <[EMAIL PROTECTED]> wrote: >>> >>> Goksie wrote: >>> > Thanks all for the past help >>> > >>> > Can someon

Opening .dat file in perl

2006-10-20 Thread Goksie
Thanks all for the past help Can someone advice me on how i can open .dat file in perl script? The sample of the file is as attached. please, i need help on it. goksie