Hi,
Sorry to ask this OT question. But i am sure I can get help here.
I was looking for a good Linux admin mailing list.
Thanks in advance
Paul,
Try this. it is pretty easy
while () {
print "$1 $2;$3\n" if $_ =~ /^(\d+)\s+(\w+)\s+(\w+)$/;
}
__DATA__
222xxxJ
222wwwDD
222ccffFFF
909eee
909FFF
909j
888JJJ
888HHH
Anidil Patinatiyil Rajend
2 10:10 AM
Subject: Re: Is there a searchable archive for this list
> on Tue, 01 Oct 2002 15:24:40 GMT, Anidil Rajendran wrote:
>
> > I dont find any search option in following site
> >
> > http://archive.develooper.com/beginners%40perl.org/
>
> Try
>
I dont find any search option in following site
http://archive.develooper.com/beginners%40perl.org/
Thanks
-
Anidil Patinatiyil Rajendran
Burlingame,California
650 730 8271 (W)
Try this to encode your file. Decoding I beleive you can do.
open (FILE, "C:\\perl\\original\.txt" ) or die ;
open (FILE1,">C:\\perl\\converted\.txt") or die ;
while () {
@ascii = unpack("C*", $_);
foreach $val (@ascii) {
$val++;
}
$_ = pack("C*", @ascii);
print FILE1;
}
close(FILE);
close(FI
Try this if you want regex.
This may not be the appropriate but works.
@list = ('1992','1993 (summer)','1995 fall');
foreach (@list) {
push @array, $1 if $_ =~ /(\d+)\s*.*$/;
}
print map {$_,"\n"} @array;
regards
Rajendran
Burlingame,CA
- Original Message -
From: "Shaun Bramley" <[
- Original Message -
> Nkuipers wrote:
>
> >>e.g. I have a file with a header - and I only need the data from line
> >>100 and forward where the single lines are put in to a array for further
> >>"treatment".
> >
>
> should probably be "$. == 100" but this is a bit better:
>
> last if($.
Hi,
I want to count the number of times a particular word occured in a file. Though the
following script is working, is it possible to shorten it?
--
open (FILE,"C:\\proj\\order\.txt") or die "cannot open file: $!";
%seen = ();
while () {
while ( /(\w['\w-]*)/g) {
$seen{lc $1}++;
}
}
The 3rd edition is definitely good.
You can also try PERL BY EXAMPLE by ellie quigley.
Perl Cookbook is definitely a must.
good luck
=rajendran
Burlingame,CA
- Original Message -
From: "Ebaad Ahmed" <[EMAIL PROTECTED]>
To: "Nitin Yogishwar" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Se
Hi,
The answer is in your question.
Cheers
- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, September 04, 2002 1:49 PM
Subject: Re: converting a list into array
> The script gave a syntax error at
>
> chomp(my @data = );
>
> However, when I tri
Newbie again.
Sorry if this question sounds so silly
Want to open filenames like ~username/blah but open doesn't interpret the tilde to
mean the
home directory
Solution
expand the filename manually with substitution
$filename =~ s{ ^ ~ ( [^/]* ) }
{ $1
ext if $fields[2] > $skip;
$highestuid = ($highestuid < $fields[2]) ? $fields[2] : $highestuid;
}
close(PW);
print "The next available UID is " . ++$highestuid . "\n";
Thanks for any suggestion.
Anidil Rajendran
Redwood Shores,CA
650 730 8271
Firstname Lastname 650 156 7190:somfield:somefield:somefield
Firstname Lastname 408 256 7290:somfield:somefield:somefield
Firstname Lastname 510 3456 7390:somfield:somefield:somefield
**more lines here ***
Firstname Lastname 415 3456 7390:somfield:somefield:somefield
I have
Firstname Lastname 650 156 7190:somfield:somefield:somefield
Firstname Lastname 408 256 7290:somfield:somefield:somefield
Firstname Lastname 510 3456 7390:somfield:somefield:somefield
I have the above lines in a file and I am trying to create an array of =
phone numbers
open (FILE,"thefile") or
Hi team,
I am unix admin trying to learn perl. How is the book "LEARNING PERL BY
EXAMPLE" by Ellie Quigley
regs
Anidil Rajendran (raj)
Netliant,Inc
3600,Brigde Parkway Suite 102
Redwood City,CA 94065-1170
(650) 730 8271
<>
15 matches
Mail list logo