Re: Fwd: perl one liiner

2005-08-18 Thread Muthukumar
> > This should do what you want: > > perl -pe's/(?<=[[:alpha:]])\d+//g' As per required ouput your one-line is showing to me as, # perl -pe 's/(?<=[[:alpha:]])\d+//g' test.log This23 is a 45 good thing # try this one. # perl -pe 's/\d+//g if /^\D+/;' test.log This is a 45 good thing -Muthu

Re: Fwd: perl one liiner

2005-08-18 Thread John W. Krahn
anu p wrote: > > Hi, Hello, > I have written a perl one liner that gets rid of > digits at the end of a word, but it also gets rid of > digits if they are at the beginning of a line. > The one liner is > > perl -ne 's/([a-z]\d+)/$1/g;' > > It doesn't work, but if I use it in a script it works

Re: perl one liiner

2005-08-18 Thread Jeff 'japhy' Pinyan
On Aug 19, Muthukumar said: perl -ne 's/([a-z]\d+)/$1/g;' If input is like the one below, This23 is a 45 good thing The result should be This is a 45 good thing # perl -ne 'if ( ! /^\d+/ ) { s/[0-9]*$//;}print' test.log That should be s/\d+$//, since \d is shorthand for [0-9] and there

Re: perl one liiner

2005-08-18 Thread Muthukumar
> perl -ne 's/([a-z]\d+)/$1/g;' > > It doesn't work, but if I use it in a script it works. > > I want to know where am I going wrong. Also I want to > know how to not get rid of digits at the beginning of > a line but the ones that follow some chars > > If input is like the one below, > > This

Fwd: perl one liiner

2005-08-18 Thread anu p
Note: forwarded message attached. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com --- Begin Message --- Hi, I have written a perl one liner that gets rid of digits at the end of a word, but

copy and run a program on remote windows

2005-08-18 Thread Ken Perl
I want to implement a module in perl to do the same thing as the tool PsExec (http://www.sysinternals.com/Utilities/PsExec.html) does, which is used to copy and run a program on remote windows, a very cool tool! So, I want to know if anyone has done this before. and If I do the implement from scr

RE: regex - no field seperator

2005-08-18 Thread Keenan, Greg John (Greg)** CTR **
-Original Message- From: John W. Krahn [mailto:[EMAIL PROTECTED] Sent: Friday, 19 August 2005 10:26 AM To: Perl Beginners Subject: Re: regex - no field seperator Keenan, Greg John (Greg)** CTR ** wrote: >>From: Wagner, David --- Senior Programmer Analyst --- WGO >> >>Keenan, Greg John (G

Re: regex - no field seperator

2005-08-18 Thread John W. Krahn
Keenan, Greg John (Greg)** CTR ** wrote: >>From: Wagner, David --- Senior Programmer Analyst --- WGO >> >>Keenan, Greg John (Greg)** CTR ** wrote: >>> >>>I have the following data that I'm trying to parse into an array. >>>There are 19 fields but with hosts 5 & 6 fields 6 & 7 do not have any >>>s

RE: regex - no field seperator

2005-08-18 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Keenan, Greg John (Greg)** CTR ** wrote: > -Original Message- >> From: Wagner, David --- Senior Programmer Analyst --- WGO >> [mailto:[EMAIL PROTECTED] >> Sent: Friday, 19 August 2005 3:21 AM >> To: Keenan, Greg John (Greg)** CTR **; beginners@perl.org >> Subject: RE: regex - no field seper

RE: regex - no field seperator

2005-08-18 Thread Keenan, Greg John (Greg)** CTR **
-Original Message- >From: Wagner, David --- Senior Programmer Analyst --- WGO >[mailto:[EMAIL PROTECTED] >Sent: Friday, 19 August 2005 3:21 AM >To: Keenan, Greg John (Greg)** CTR **; beginners@perl.org >Subject: RE: regex - no field seperator > >Keenan, Greg John (Greg)** CTR ** wrote: >>

Re: Use of uninitialized value in string at ... ??

2005-08-18 Thread Manav Mathur
> Hello, > > I got the following function online but and receiving the error and > do not know why ? > Use of uninitialized value in string at ./sat-main.pl line 211, > line 1 > > Here is the code: > > my $input; > > $input = &user_func("Enter command "); > > sub user_func { > my $user_i

Use of uninitialized value in string at ... ??

2005-08-18 Thread Michael Gale
Hello, I got the following function online but and receiving the error and do not know why ? Use of uninitialized value in string at ./sat-main.pl line 211, line 1 Here is the code: my $input; $input = &user_func("Enter command "); sub user_func { my $user_input; my ($promptStrin

Re: parsing columns

2005-08-18 Thread Offer Kaye
On 8/18/05, Wiggins d'Anconia wrote: > > Though in that case I guess you might be able to determine that it is > column two because there aren't two spaces, Alas, were it that simple... :( An extra space will not be included, even if the l3dat2 would actually have been l3dat3... > but that is s

Re: Memory Testing

2005-08-18 Thread Chris Devers
On Thu, 18 Aug 2005 [EMAIL PROTECTED] wrote: >I am in need to do some memory stress testing. Is there a way to > use C style malloc or calloc, to allocate blocks at a time ?? Not that I can think of, though there may be something under the B::* module namespace that does that. Alternativel

Re: Finding matches and use of __END__ in a one-liner

2005-08-18 Thread John W. Krahn
KEVIN ZEMBOWER wrote: > John, thank you so much for both your suggestions. Even though Manav's > suggestions > work, I learned a little more perl looking up the parts I didn't understand > in your > suggestions. With just a slight modification, both of these worked: > > perl -l -0777ne'print /L:

Re: regex - no field seperator

2005-08-18 Thread Bryan R Harris
>> I have the following data that I'm trying to parse into an array. >> There are 19 fields but with hosts 5 & 6 fields 6 & 7 do not have any >> space between them. This is how I get it from the OS and have no >> control over it. >> >> The maximum length for field 6 is 7 chars and field 7 is 6 c

RE: regex - no field seperator

2005-08-18 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Keenan, Greg John (Greg)** CTR ** wrote: > Hi, > > I have the following data that I'm trying to parse into an array. > There are 19 fields but with hosts 5 & 6 fields 6 & 7 do not have any > space between them. This is how I get it from the OS and have no > control over it. > > The maximum len

Re: parsing columns

2005-08-18 Thread Wiggins d'Anconia
Marcello wrote: > Manav Mathur ha scritto: > >>> Hi all, >>> I have a text file with columns, where the columns may not be aligned, >>> and not all lines may have data in all columns: >>> >>> header1 header2 header3header4 >>> ---

Re: Finding matches and use of __END__ in a one-liner

2005-08-18 Thread KEVIN ZEMBOWER
John, thank you so much for both your suggestions. Even though Manav's suggestions work, I learned a little more perl looking up the parts I didn't understand in your suggestions. With just a slight modification, both of these worked: perl -l -0777ne'print /L:(.+)\s/, q/@/, /H:(.+)\s/' `find -n

Memory Testing

2005-08-18 Thread mgoland
Hi All, I am in need to do some memory stress testing. Is there a way to use C style malloc or calloc, to allocate blocks at a time ?? Thanks in advance, Mark G. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: splitting data stream

2005-08-18 Thread Jeff 'japhy' Pinyan
On Aug 18, Octavian Rasnita said: I want to use regular expressions (or other techniques) to split a data stream which has the following format: ... The is a 4 digit number and tells the size of the next body it should get. You can roll your own with substr() and what-not, or you can use th

Re: passing variables from perl to the system

2005-08-18 Thread Jeff 'japhy' Pinyan
On Aug 18, Eliyah Kilada said: Do anyone know how to pass the perl variables to the system in order to be used later?! A process cannot modify its parent's environment. You can set environment variables to be used during the Perl program that are visible to the Perl program's child processe

Re: passing variables from perl to the system

2005-08-18 Thread Xavier Noria
On Aug 18, 2005, at 13:38, Eliyah Kilada wrote: Do anyone know how to pass the perl variables to the system in order to be used later?! Perl offers built-in support for environment variables via the %ENV hash: % cat foo.pl $ENV{FOO} = "foo"; system q(echo $FOO); % perl foo

RE: splitting data stream

2005-08-18 Thread Moon, John
From: Octavian Rasnita [mailto:[EMAIL PROTECTED] Sent: Thursday, August 18, 2005 8:04 AM To: beginners perl Subject: splitting data stream Hi, I want to use regular expressions (or other techniques) to split a data stream which has the following format: ... The is a 4 digit number and tells t

passing variables from perl to the system

2005-08-18 Thread Eliyah Kilada
Hi, Do anyone know how to pass the perl variables to the system in order to be used later?! I though of passing them as enviromental variables using system (export, "sys_var_name","= $perl_var_name" ); but it doesn't work -:( Any help is highly appreciated! Best Regards, Eliyah -- To uns

splitting data stream

2005-08-18 Thread Octavian Rasnita
Hi, I want to use regular expressions (or other techniques) to split a data stream which has the following format: ... The is a 4 digit number and tells the size of the next body it should get. Thank you very much. Teddy -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,

Re: regex - no field seperator

2005-08-18 Thread John Doe
Keenan, Greg John (Greg)** CTR ** am Donnerstag, 18. August 2005 05.34: > Hi, > > I have the following data that I'm trying to parse into an array. There > are 19 fields but with hosts 5 & 6 fields 6 & 7 do not have any space > between them. This is how I get it from the OS and have no control ov

Re: parsing columns

2005-08-18 Thread Marcello
Manav Mathur ha scritto: Hi all, I have a text file with columns, where the columns may not be aligned, and not all lines may have data in all columns: header1 header2 header3header4 l1dat1l1dat2l1dat3