Can someone please provide some assitance with a multi-line matching
problem? I have a datafile that looks like this:
Input file
START
foo1
bar1
END
START
foo2
bar2
END
START
foo3
bar3
END
I am trying to capture the contents between the START and END
delineators. Here is what I have
nt $&'
Thanks again,
Jose
On Wed, 2004-01-14 at 18:37, Jeff Westman wrote:
> Jose Malacara <[EMAIL PROTECTED]> wrote:
>
> > Can someone explain to me how to do multiline matching? I am
> > trying to extract three consecutive lines from a datafile
> >
Can someone explain to me how to do multiline matching? I am trying to extract three
consecutive lines from a datafile containing multiple records like this:
Name: Bob
City: Austin
State: Texas
Address: 123 Whatever
Age: 46
Name: Jose
City: Denver
State: Colorado
Address: 118 Mystreet
Age: 28
Is it possible to use more than one format in a script? I am parsing a log file to
STDOUT and would like to be able to write to two (or more) different formats depending
on the information found in the log.
This is what I'm trying to do:
1. open and read logfile
2. if you find "some_string" pr
ut:
===
$./test.pl
IO::Filter::gzip=HASH(0x8132004)
--
Jose Malacara
[EMAIL PROTECTED]
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
I have tried IP address as well and get the same error message. I have
considered alternate ways of doing this, but now I'm bent on figuring out
why this isn't working for me!
Thanks for the input.
Jose
- Original Message -
From: "TN" <[EMAIL PROTECTED]>
To:
.
- Original Message -
From: "R. Joseph Newton" <[EMAIL PROTECTED]>
To: "Jose Malacara" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, October 01, 2003 7:49 AM
Subject: Re: Fw: Net::SCP::Expect
> Jose Malacara wrote:
>
> > Sor
Sorry if this comes across twice. It bounced back the first time...
Would someone mind telling me what I am doing wrong here please. I am trying to tie
the SCP Expect module into a backup script I put together, but it keeps failing. I
stripped out all but the SCP example code and it still gener
Would someone mind telling me what I am doing wrong here please. I am trying to tie
the SCP Expect module into a backup script I put together, but it keeps failing. I
stripped out all but the SCP example code and it still generates an error from the
module. I verified my login, directory and fil
I have put together a script using the Perl Expect module to log into multiple hosts
and execute a list of commands. I would like to be able to capture the output from
each host and pattern match against it. The script (login and and issue commands)
works fine, but I need some help on the captur
$line);
instead of:
@array = split(/,/, $line);
if ($array[0] eq $value) {
This was causing my match to fail because it was trying to match against
the entire line of input instead of just the IP.
Thanks to all that helped.
Jose
On Fri, 2003-04-04 at 17:54, Wiggins d'Anconia wrote:
> Jose M
Can someone help me out here, please.
I have an if statement that is looping over a list of IP addresses:
192.168.1.1
192.168.1.2
192.168.1.3 ...192.168.1.10
$value="192.168.1.1"
if ($line =~ /($value)/) ...
I only want to match the value exactly (192.168.1.1). My problem is that I am matching
Does anyone recommend a good general programming book? Something that's not so much
language specific, but more about methodologies, techniques, etc. I don't have a
programming background, so I tend to have the most trouble when it comes to looking at
the larger picture and how a program should
You should be able to do this using the Perl Expect module, although not
sure about the Windows part.
-Jose
- Original Message -
From: "Prachi Shah" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, February 10, 2003 1:08 PM
Subject: run UNIX commands from windows using Perl
> H
Yes, with $ARGV[0]. The number is the variable postion. 0 is the first.
#!/usr/bin/perl
$name = $ARGV[0];
print "Hello, $name!\n";
-Jose
- Original Message -
From: "Thomas Browner" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, February 07, 2003 2:04 PM
Subject: variable fro
ot;;
}
}
}
}
closedir(DIR);
close INFILE;
==
- Original Message -
From: "Wiggins d'Anconia" <[EMAIL PROTECTED]>
To: "Jose Malacara" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, February 04, 2003 8:11 PM
Hello.
I have a script that parses csv files for the occurence of an IP address that is
passed to the script as an argument when it runs. Currently, I can only run the script
from within the same directory as my data files. I would like to be able to move my
csv files into a separate data direc
Is there a way for perl to suppress or mask user input at the STDIN? For example, a
password or login prompt Not really trying to implement any real security here,
just curious.
This is what I I would like:
Enter your login:# suppressed from output
Welcome, admin.
or
Enter you
Hello. I have a python script that I would like to convert to perl. In it I am parsing
a data file looking for occurences of three consecutive lines:
series1 = """
slot-1 UPUP t3-card
slot-2 UPUP madd2-card
slot-3 UPUP madd2-card"""
or
Hello. I have a logfile in which every message begins with a timestamp (ex. -
20012091500). I would like to be able to remove the last 4 characters (1500) off each
of these to derive the date only (2001209). It works by chopping of each character
individually, but I would like to know if there i
Can someone please tell me what I'm doing wrong here?
I have a data file that looks like this:
jason,texas,austin
tim,denver,colorado
jose,oregon,portland
And a script to update the last field and output the results with the
new city:
#!/usr/bin/perl -w
open(DATAFILE, "datafile") || die "Una
I would like to be able to verify the presence and syntax of an argument coming into
my script prior to actually doing anything with it. My script is execpting to see
something like this
../myscript server10.boston
or
../myscript server30.california
I am able to check for the presense of an a
Are you wanting to telnet into a router and issue the 'show run' command to get the
info or is the config stored locally on a server somewhere?
"Steve" wrote:
> Can anyone help me get the description field from a CISCO
> router config and posting it to a page...
>
> Thanks,
>Steve
>
>
>
Hello. I am interested in writing a Perl script that can do the following:
1. read a list of user defined commands from a file
2. telnet (or possibly ssh) to a device such as a router, login, and interactively
issue the commands read from the command list.
3. return the output from the commands
I realize this is not protecting me from anything really. It originally
started out as a question of curiosity..._That's all_.
- Original Message -
From: "Michael Fowler" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, September 11, 2002 1:26 PM
Subject: Re: hiding a URL
>
hiding a URL
>
> On Tuesday, Sep 10, 2002, at 18:45 US/Eastern, Michael Fowler wrote:
>
> > On Mon, Sep 09, 2002 at 11:56:59PM -0600, Jose Malacara wrote:
> >> Is there an easy way to hide ,or spoof, a URL when outputting to html
> >> with
> >>
Is there an easy way to hide ,or spoof, a URL when outputting to html with
perl? For example if I was running a script in my cgi-bin directory, but
wanted the URL to appear differently so as to hide location of my
cgi-directory.
For example, if a visitor is looking at a page located at:
www.myweb
Thanks to all who replied with the useful advice. I really appreciate the
help. Thanks!
Jose
- Original Message -
From: "Tor Hildrum" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; "Perl" <[EMAIL PROTECTED]>
Sent: Wednesday, August 14, 2002 3:53 AM
Subject: Re: open file into hash
> <[EM
Hello. I was wondering if there was a way to open a file into a hash? I know
this works for arrays, but was wondering if I this could be done for a hash
also.
I have a file called people.data, which contains two colums:
jose2
karen 8
jason 9
tracey 1
Can someo
Hello. I was wondering if there is a way to capture a system command into a
perl variable. I know this is incorrect, but I basically want to do something
like this:
$date = system("date");
print "Today is $date.";
Thanks,
Jose
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional comman
} elsif ( (m|City=|)) {
# $city = $';
# print "City=$city\n";
# print "Location=$city$state\n";
# }
# }
Thanks again,
Jose Malacara
>From: Kristina Nairn <[EMAIL PROTECTED]>
>To: "Jose Malacara" <[EMAIL PROTECT
ss my main question would be how to keep the 'State' value associated
with the cities that follow it.
Any help/suggestions would be greatly appreciated!
Thank you,
Jose Malacara
_
Chat with friends online, try
32 matches
Mail list logo