You want something like this:
#!/software/bin/perl
use warnings;
use strict;
my $file = "example.txt";
open my $in, '<', $file or die "Cannot open '$file' because: $!";
while ( <$in> ) {
next if /^#/;
chomp;
my ( $key, @fields ) = split /\t/;
print map "$key\t$_\n", @fields;
thanks a lot Rob
I would like an output without the $VAR...
so I did add this after the push function and it is perfect, thanks a
lot again
foreach my $number(@othernumbers){print $rownum,"\t",$elet, "\n";}
#!/usr/local/bin/perl
use strict;
use warnings;
my $fh;
my %results;
open ( $fh,
nathalie wrote:
Hi
Hello,
I have this format of file: (see attached example)
1 3206102-3207048 3411782-3411981 3660632-3661428
2 4481796-4482748 4483180-4483486
and I would like to change it to this
1 3206102-3207048
1 3411782-3411981
1 3660632-3661428
2 4481796-4482748
2 4483180-4483486
On Thu, May 31, 2012 at 11:37 AM, nathalie wrote:
>
>
> Hi
> I have this format of file: (see attached example)
> 1 3206102-3207048 3411782-3411981 3660632-3661428
> 2 4481796-4482748 4483180-4483486
>
>
> and I would like to change it to this
> 1 3206102-3207048
> 1 34117
Hi
I have this format of file: (see attached example)
1 3206102-3207048 3411782-3411981 3660632-3661428
2 4481796-4482748 4483180-4483486
and I would like to change it to this
1 3206102-3207048
1 3411782-3411981
1 3660632-3661428
2 4481796-4482748
2 44
1 2:50 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: RE: [Perl-unix-users] Script Help Please
Steve,
I made the correction as follows:
if (/\bUP\b/ && /$server_name/) Does not work.
I also tried:
if (/$server_name/) Does not work.
And:
if (/\b$server_name
> "Craig" == Craig Sharp <[EMAIL PROTECTED]> writes:
Craig> my %servers; (This is defining a hash?)
Craig> open (I understand)
Craig> {
Craig> chomp (my @temp = ); (Removing the newline from each entry)
Craig> @server{ @temp } =(); (What's this do?);
Craig> }
It's a hash slice, which contra
John,
Thanks for the info. I am a bit confused in the first part of the script.
my %servers; (This is defining a hash?)
open (I understand)
{
chomp (my @temp = ); (Removing the newline from each entry)
@server{ @temp } =(); (What's this do?);
}
Thanks,
Craig
>>> "John W. Krahn" <[EMAIL PROT
Craig Sharp wrote:
>
> I am lost. I have the following script that opens the log file WUGEvent.log and
>looks for the
> statment "UP", replaces spaces and writes out the new log file. It works great!
>
> Here is the problem. I need to read in another file (wuglist.txt) containing a list
>of
hat occurs least frequently on the left of the &&
as the right-hand side is only evaluated if the left-hand expression returns
true.
Steve Aaron
-Original Message-
From: Craig Sharp [mailto:[EMAIL PROTECTED]]
Sent: Monday, November 26, 2001 12:45 PM
To: [EMAIL PROTECTED]
Cc:
> Can anyone confirm if I understand this right:
>
> if ( $username =~ /@/ )
> {
>$_ = $username;
>($username) = /(.*)\@/;
> }
>
> The part
> ($username) = /(.*)\@/;
> removes the @ symbol?
Yes, but what if you've got two @'s? ;-)
The two lines in the 'if' can be rewritten as:
$us
PROTECTED]]
Sent: Monday, November 26, 2001 12:45 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: [Perl-unix-users] Script Help Please
Hi all,
I am lost. I have the following script that opens the log file WUGEvent.log
and looks for the statment "UP", replaces spaces and writes
November 2001 12:45
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Script Help Please
Hi all,
I am lost. I have the following script that opens the log file
WUGEvent.log and looks for the statment "UP", replaces spaces and writes
out the new log file. It works great!
Here is the p
Hi all,
I am lost. I have the following script that opens the log file WUGEvent.log and looks
for the statment "UP", replaces spaces and writes out the new log file. It works
great!
Here is the problem. I need to read in another file (wuglist.txt) containing a list
of server names and then
14 matches
Mail list logo