Re: Help required to extract multiple text fields from a text string

2012-05-27 Thread Michael Rasmussen
On Sun, May 27, 2012 at 07:24:26PM -0700, John W. Krahn wrote: > Michael Rasmussen wrote: >> [ a bunch of blather, snipped here ] > > The regular expression is not splitting! It is capturing. > split removes whitespace. > The regular expression captures non-whitespace. > So the two expressions pos

Re: Help required to extract multiple text fields from a text string

2012-05-27 Thread John W. Krahn
Michael Rasmussen wrote: On Sat, May 26, 2012 at 05:52:19PM +0100, Rob Dixon wrote: On 26/05/2012 14:07, pa...@fsmail.net wrote: From: "Rob Dixon" On 26/05/2012 13:51, pa...@fsmail.net wrote: split is slower than the correct regex matching. That is complete nonsense. Can you show a bench

Re: Help required to extract multiple text fields from a text string

2012-05-27 Thread Michael Rasmussen
On Sat, May 26, 2012 at 05:52:19PM +0100, Rob Dixon wrote: > On 26/05/2012 14:07, pa...@fsmail.net wrote: >> From: "Rob Dixon" >>> On 26/05/2012 13:51, pa...@fsmail.net wrote: split is slower than the correct regex matching. >>> >>> That is complete nonsense. Can you show a benchmark tha

Re: Help required to extract multiple text fields from a textstring

2012-05-27 Thread Dr.Ruud
On 2012-05-26 14:51, pa...@fsmail.net wrote: split is slower than the correct regex matching. -- Ruud -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Help required to extract multiple text fields from a text string

2012-05-27 Thread Shawn H Corey
On 12-05-27 02:00 AM, Shlomi Fish wrote: On Sat, 26 May 2012 20:26:14 -0700 Adams Paul wrote: > > Sent from my LG phone > Why have you already sent 4 messages to this mailing list, which contain nothing except this "Sent from my LG phone" notice and the entire replied-to message quoted below

Re: Help required to extract multiple text fields from a text string

2012-05-26 Thread Shlomi Fish
Hi Paul, On Sat, 26 May 2012 20:26:14 -0700 Adams Paul wrote: > > Sent from my LG phone > Why have you already sent 4 messages to this mailing list, which contain nothing except this "Sent from my LG phone" notice and the entire replied-to message quoted below (with only a plain text part)? I

Re: Help required to extract multiple text fields from a text string

2012-05-26 Thread Adams Paul
Sent from my LG phone Jim Gibson wrote: > >On May 26, 2012, at 5:51 AM, pa...@fsmail.net wrote: > >> split is slower than the correct regex matching. >> > >Did you know that split uses a regular expression to find the separators on >which to split the string? So your claim is unlikely to be t

Re: Help required to extract multiple text fields from a text string

2012-05-26 Thread Chris Charley
""Christopher Gray"" wrote in message news Good day, I have a text file containing records. While I can extract single sub-strings, I cannot extract multiple sub-strings. The records are of multiple types - only about a third of which have the data I need. An example of a "good" record is A

RE: Help required to extract multiple text fields from a text string

2012-05-26 Thread Christopher Gray
Brilliant - a first class "teach-in". Many thanks for the description - it all works. Brilliant. -Original Message- From: Rob Dixon [mailto:rob.di...@gmx.com] Sent: 26 May 2012 2:13 PM To: beginners@perl.org Cc: Christopher Gray Subject: Re: Help required to extract mul

Re: Help required to extract multiple text fields from a text string

2012-05-26 Thread Rob Dixon
On 26/05/2012 14:07, pa...@fsmail.net wrote: From: "Rob Dixon" On 26/05/2012 13:51, pa...@fsmail.net wrote: split is slower than the correct regex matching. That is complete nonsense. Can you show a benchmark that supports your claim? There are many cases prove that, I am just lazy to fin

Re: Help required to extract multiple text fields from a text string

2012-05-26 Thread Jim Gibson
On May 26, 2012, at 5:51 AM, pa...@fsmail.net wrote: > split is slower than the correct regex matching. > Did you know that split uses a regular expression to find the separators on which to split the string? So your claim is unlikely to be true. In any case, the difference between using spli

Re: Help required to extract multiple text fields from a text string

2012-05-26 Thread Rob Dixon
On 25/05/2012 21:51, Christopher Gray wrote: Good day, I have a text file containing records. While I can extract single sub-strings, I cannot extract multiple sub-strings. The records are of multiple types - only about a third of which have the data I need. An example of a "good" record is

Re: Help required to extract multiple text fields from a text string

2012-05-26 Thread pangj
There are many cases prove that, I am just lazy to find one. You don't know it, so it's nonsense? Message Received: May 26 2012, 01:58 PM From: "Rob Dixon" To: beginners@perl.org Cc: pa...@fsmail.net Subject: Re: Help required

Re: Help required to extract multiple text fields from a text string

2012-05-26 Thread Rob Dixon
On 26/05/2012 13:51, pa...@fsmail.net wrote: split is slower than the correct regex matching. That is complete nonsense. Can you show a benchmark that supports your claim? Rob -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org h

Re: Help required to extract multiple text fields from a text string

2012-05-26 Thread pangj
split is slower than the correct regex matching. Message Received: May 26 2012, 10:59 AM From: "Dr.Ruud" To: beginners@perl.org Cc: Subject: Re: Help required to extract multiple text fields from a text string On 2012-05-25 22:51, C

Re: Help required to extract multiple text fields from a text string

2012-05-26 Thread Dr.Ruud
On 2012-05-25 22:51, Christopher Gray wrote: I have a text file containing records. While I can extract single sub-strings, I cannot extract multiple sub-strings. Try split, see perldoc -f split. while ( my $line= <$fh_in> ) { my @data= split ' ', $line; ; } --

Re: Help required to extract multiple text fields from a text string

2012-05-26 Thread timothy adigun
Hi Chris, On Sat, May 26, 2012 at 8:14 AM, Christopher Gray < christopher.g...@talktalk.net> wrote: > Hi, > > Thank you for looking to help me. Unfortunately, when I used your code > nothing was extracted. At least when I printed $1 nothing appeared. > > In order to help me learn more about Per

RE: Help required to extract multiple text fields from a text string

2012-05-26 Thread Christopher Gray
type\s+(\d+)\s+} would extract the number following "fruittype" Individually they do - it is just when I add then together in the same line that I receive nothing. What am I doing wrong? Chris -Original Message- From: pa...@fsmail.net [mailto:pa...@fsmail.net] Sent: 25 M

Re: Help required to extract multiple text fields from a text string

2012-05-25 Thread timothy adigun
Hi Chris, On Fri, May 25, 2012 at 11:53 PM, wrote: > > May you try this matching? > > while() { >next unless /^(\S+\s+)(\S+\s+)(\S+\s+).*\"(.*?)\"/; >print "$1 $2 $3 $4\n"; > } > > HTH. > > > Message Received: May 25 2012, 09:52 PM > From: "Chri

RE: Help required to extract multiple text fields from a text string

2012-05-25 Thread pangj
May you try this matching? while() { next unless /^(\S+\s+)(\S+\s+)(\S+\s+).*\"(.*?)\"/; print "$1 $2 $3 $4\n"; } HTH. Message Received: May 25 2012, 09:52 PM From: "Christopher Gray" To: beginners@perl.org Cc: Subject: Help required to ex

Re: Help required in writing a script

2008-10-28 Thread Philip Durbin
On Oct 23, 2008, at 11:22 AM, Philip Durbin wrote: monnappa appaiah wrote: i need help on something i'm working on.I have 127 systems connected in the network, i want to write a script which will run on a management server, i shud be able to connect to each and every s

Re: Help required in writing a script

2008-10-23 Thread Rob Dixon
Chas. Owens wrote: > On Thu, Oct 23, 2008 at 18:07, Rob Dixon <[EMAIL PROTECTED]> wrote: >> >> Microsoft's 'nmake' is available for free, but some versions have been more >> compatible with standard modules than others, and in any case, as there is >> still >> no C compiler, on its own it is a sol

Re: Help required in writing a script

2008-10-23 Thread Chas. Owens
On Thu, Oct 23, 2008 at 18:07, Rob Dixon <[EMAIL PROTECTED]> wrote: snip > In their endless search for money, Microsoft don't supply a C compiler, > assembler, or linker with any version of Windows in the last twenty years or > so. > Also, because of several deliberate decisions to make people pay

Re: Help required in writing a script

2008-10-23 Thread Rob Dixon
monnappa appaiah wrote: > >i tried to install the "Expect" modulebut i got the below > error msg: [snip] > cpan> install Expect > Running install for module 'Expect' [snip] > Checking if your kit is complete... > Looks good > Warning: prerequisite IO::Pty 1.03 not found. > Warn

Re: Help required in writing a script

2008-10-23 Thread Chas. Owens
On Thu, Oct 23, 2008 at 16:18, monnappa appaiah <[EMAIL PROTECTED]> wrote: snip >i tried to install the "Expect" modulebut i got the below > error msg: snip > ERROR: cannot run the configured compiler 'cl' > (see conf/compilerok.log). Suggestions: > 1) The complier 'cl' is not in yo

Re: Help required in writing a script

2008-10-23 Thread monnappa appaiah
Hi, i tried to install the "Expect" modulebut i got the below error msg: cpan> m /Expect/ Going to read C:\Perl\cpan\Metadata Database was generated on Mon, 20 Oct 2008 08:27:31 GMT ModuleBio::MAGE::QuantitationType::ExpectedValue (JASONS/Bio-MAGE-20020902.6 .tar.gz) Module

Re: Help required in writing a script

2008-10-23 Thread Chas. Owens
On Thu, Oct 23, 2008 at 10:49, monnappa appaiah <[EMAIL PROTECTED]> wrote: > i want to run specific commands and the output of those shud be put into a > file. snip So, you will need to learn to use: Net::SSH (if you want to use keys, this is preferable) - http://search.cpan.org/dist/Net-SSH/SSH.

Re: Help required in writing a script

2008-10-23 Thread Philip Durbin
monnappa appaiah wrote: i need help on something i'm working on.I have 127 systems connected in the network, i want to write a script which will run on a management server, i shud be able to connect to each and every system (all the systems have same password) and execute ce

Re: Help required in writing a script

2008-10-23 Thread monnappa appaiah
i want to run specific commands and the output of those shud be put into a file. On Thu, Oct 23, 2008 at 8:13 PM, Chas. Owens <[EMAIL PROTECTED]> wrote: > On Thu, Oct 23, 2008 at 10:34, monnappa appaiah <[EMAIL PROTECTED]> > wrote: > > Hi, > > i connect to machines using ssh, i need to co

Re: Help required in writing a script

2008-10-23 Thread Chas. Owens
On Thu, Oct 23, 2008 at 10:34, monnappa appaiah <[EMAIL PROTECTED]> wrote: > Hi, > i connect to machines using ssh, i need to collect only > stdout..connecting to all those machines serially or parllely is fine. > > Thanks, > Monnappa snip Do you want to run arbitrary commands at any tim

Re: Help required in writing a script

2008-10-23 Thread monnappa appaiah
Hi, i connect to machines using ssh, i need to collect only stdout..connecting to all those machines serially or parllely is fine. Thanks, Monnappa On Thu, Oct 23, 2008 at 7:50 PM, Chas. Owens <[EMAIL PROTECTED]> wrote: > On Thu, Oct 23, 2008 at 09:36, monnappa appaiah <[EMAIL PROTE

Re: Help required in writing a script

2008-10-23 Thread Chas. Owens
On Thu, Oct 23, 2008 at 09:36, monnappa appaiah <[EMAIL PROTECTED]> wrote: > Hi all, > > i need help on something i'm working on.I have 127 > systems connected in the network, i want to write a script which will run on > a management server, i shud be able to connect to each an

Re: Help required in writing a script

2008-10-23 Thread Rodrick Brown
Look at Net::SSH. On Thu, Oct 23, 2008 at 9:36 AM, monnappa appaiah <[EMAIL PROTECTED]>wrote: > Hi all, > > i need help on something i'm working on.I have 127 > systems connected in the network, i want to write a script which will run > on > a management server, i shud be abl

Re: Help Required on the Below Script

2006-06-14 Thread JupiterHost.Net
Hello, use strict; use warnings; Excellent use of those :) my $file_name=".txt"; open(FILE,"$file_name") || die "Not been Accessed"; Good that you checked for failure, why not also report the error ... Also, don't double quote strings that have nothing to be interpolated or are

Re: Help Required on the Below Script

2006-06-14 Thread Mazhar
Thanks everybody for the support.. it is working fine.. Regards Mazhar On 6/14/06, John W. Krahn <[EMAIL PROTECTED]> wrote: Mazhar wrote: > Hello, Hello, > I am writing perl on windows installing Activestate Perl and the code is > reading a text file and processing it, > > the code what i

Re: Help Required on the Below Script

2006-06-14 Thread John W. Krahn
Mazhar wrote: > Hello, Hello, > I am writing perl on windows installing Activestate Perl and the code is > reading a text file and processing it, > > the code what i use is... > > ## > use strict; > use warnings; > > my $file_name=".txt"; > > open(FILE,

Re: Help Required on the Below Script

2006-06-14 Thread Mr. Shawn H. Corey
On Wed, 2006-14-06 at 15:59 +0400, Mazhar wrote: > Hello, > > I am writing perl on windows installing Activestate Perl and the code is > reading a text file and processing it, > > the code what i use is... > > ## > use strict; > use warnings; > > my $file_name="X

Re: Help Required on the Below Script

2006-06-14 Thread Prabu Ayyappan
On 6/14/06, Mazhar <[EMAIL PROTECTED]> wrote: Hello, I am writing perl on windows installing Activestate Perl and the code is reading a text file and processing it, the code what i use is... ## use strict; use warnings; my $file_name=".txt"; open(FILE

Re: What is Variable Interpolation [was: Re: Help Required on the Script]

2006-04-07 Thread D. Bolliger
John W. Krahn am Freitag, 7. April 2006 01.09: > D. Bolliger wrote: > > btw, @04 is not a valid (array) variable name; they must not start with a > > digit, as not keyword/builtin does. > > $ perl -Mwarnings -Mstrict -le' our @04 = 10 .. 14; print "@04"' > 10 11 12 13 14 > > You are probably thinki

Re: What is Variable Interpolation [was: Re: Help Required on the Script]

2006-04-06 Thread John W. Krahn
D. Bolliger wrote: > > btw, @04 is not a valid (array) variable name; they must not start with a > digit, as not keyword/builtin does. $ perl -Mwarnings -Mstrict -le' our @04 = 10 .. 14; print "@04"' 10 11 12 13 14 You are probably thinking scalars and/or lexicals. John -- use Perl; program

What is Variable Interpolation [was: Re: Help Required on the Script]

2006-04-06 Thread D. Bolliger
Mazhar am Donnerstag, 6. April 2006 11.48: > thanks Raymond for the help it works, > and what do u mean by variable interpolation Hello Mazhar It will help you a lot to know and use the documentation system of perl. You can get an overview by typing (on the command line): perldoc perl (docs) p

RE: Help Required on the Script

2006-04-06 Thread Raymond Raj
> -Original Message- > From: Mazhar [mailto:[EMAIL PROTECTED] > Sent: Thursday, April 06, 2006 3:19 PM > To: [EMAIL PROTECTED] > Cc: beginners@perl.org > Subject: Re: Help Required on the Script > > > thanks Raymond for the help it works, > and what do u

Re: Help Required on the Script

2006-04-06 Thread Mazhar
gt; > To: Jaime Murillo > > Cc: beginners@perl.org > > Subject: Re: Help Required on the Script > > > > > > Thank you giyz for the help i require one more help from > > yourside. i have > > one more code where in i am getting error on print of a value

RE: Help Required on the Script

2006-04-06 Thread Raymond Raj
> -Original Message- > From: Mazhar [mailto:[EMAIL PROTECTED] > Sent: Thursday, April 06, 2006 2:41 PM > To: Jaime Murillo > Cc: beginners@perl.org > Subject: Re: Help Required on the Script > > > Thank you giyz for the help i require one more help from > yo

Re: Help Required on the Script

2006-04-06 Thread swayam panda
nks Swayam - Original Message - From: "Mazhar" <[EMAIL PROTECTED]> To: "Jaime Murillo" <[EMAIL PROTECTED]> Cc: Sent: Thursday, April 06, 2006 2:41 PM Subject: Re: Help Required on the Script Thank you giyz for the help i require one more help from yourside.

Re: Help Required on the Script

2006-04-06 Thread Mazhar
Thank you giyz for the help i require one more help from yourside. i have one more code where in i am getting error on print of a value of a variable, below is the code #!/usr/bin/perl -w use strict; use warnings; my $string="[EMAIL PROTECTED]"; print $string; On executing the above i get the

Re: Help Required on the Script

2006-04-05 Thread Mazhar
thanks Jamie. It is Working. Regards Mazhar On 4/5/06, Jaime Murillo <[EMAIL PROTECTED]> wrote: > > On Tuesday 04 April 2006 23:46, Mazhar wrote: > > Hi Guyz, > > Hi Mazhar, > > > i am writin a script to automate the command snmpwalk by > > reading the contents of a file. Below is th

Re: Help Required on the Script

2006-04-05 Thread Jaime Murillo
On Tuesday 04 April 2006 23:46, Mazhar wrote: > Hi Guyz, Hi Mazhar, > i am writin a script to automate the command snmpwalk by > reading the contents of a file. Below is the snippet > > $file_name="somefile.txt"; > > open(FILE,"< $file_name"); > > while() > { > my $ip; >

RE: Help Required on the Script

2006-04-05 Thread Raymond Raj
> -Original Message- > From: Mazhar [mailto:[EMAIL PROTECTED] > Sent: Wednesday, April 05, 2006 12:16 PM > To: beginners@perl.org > Subject: Help Required on the Script > > > Hi Guyz, > i am writin a script to automate the command > snmpwalk by reading > the contents of a fil

RE: help required regarding Win32::OLE

2006-02-09 Thread Toby Stuart
> -Original Message- > From: a b [mailto:[EMAIL PROTECTED] > Sent: Thursday, 9 February 2006 11:47 PM > To: libwin32@perl.org; beginners@perl.org > Subject: help required regarding Win32::OLE > > > Hello all perl gurus, > > i'm sticking out with the issue of changing configuration of

Re: Help required about NET::TELNET

2005-12-05 Thread Stephen Kratzer
Mazhar, try: $telnet->waitfor(Match => '/login: $/i'); and $telnet->waitfor(Match => '/password: $/i'); Vishal, Right, you want to wait for the device to return something that will match the expression between the slashes. In that example, you'd be waiting for the device to return a login prom

Re: Help required about NET::TELNET

2005-12-05 Thread vmalik
Hey Mazhar, I don't know much about perl, but in the $telnet->waitfor method, what does the weird parameter mean ('/login: $/i')? I thought that $ means a scalar variable in perl. What do the forward slashes do here? Some sort of regular expression?? Vishal Quoting Mazhar <[EMAIL PROTECTED]>:

Re: Help required with DBI

2004-07-24 Thread David Dorward
On Sat, 2004-07-24 at 19:14, NandKishore.Sagi wrote: > $data_source = "dbi:DriverName:database_name" ; > > Can't locate DBD/DriverName.pm in Change "DriveName" to the name of the driver you want to use (e.g. mysql) Change "database_name" to the name of the database you want to use. -- David

RE: "Help Required" might not get you help

2003-11-14 Thread Charles K. Clarkson
Rob Richardson <[EMAIL PROTECTED]> wrote: : : A general thought: Subject lines should tell people what the : subject of the e-mail is. On many lists and newsgroups : dedicated to programming languages, many of the most : knowledgeable people won't bother reading messages with vague : subjects li

Re: "Help Required" might not get you help

2003-11-14 Thread Rob Dixon
Rob Richardson wrote: > > A general thought: Subject lines should tell people what the subject > of the e-mail is. On many lists and newsgroups dedicated to > programming languages, many of the most knowledgeable people won't > bother reading messages with vague subjects like "Help Required". Th

Re: Help Required

2003-11-14 Thread Tore Aursand
On Fri, 14 Nov 2003 00:17:29 -0600, Andrew Gaffney wrote: >> In my cgi script I want to open some site let us suppose >> http://www.google.com > use CGI; > > my $cgi = new CGI; > print $cgi->header; > print "location.href = 'http://www.google.com'; > > There

RE: Help Required

2003-11-14 Thread NYIMI Jose (BMB)
perldoc CGI See section : GENERATING A REDIRECTION HEADER GENERATING A REDIRECTION HEADER print $query->redirect('http://somewhere.else/in/movie/land'); Sometimes you don't want to produce a document yourself, but simply redirect the browser elsewhere, perhaps choosing a URL based on the time

Re: Help Required

2003-11-13 Thread Andrew Gaffney
Amit Sharma wrote: Hi, I have written one cgi script which gets the input from user and modify one xml file and I got this string as output http://prv-arweb3.Test.com/Remedy/servlet/Servlet?URL=http://asharma.Test.co m/Query1.xml&TURL=http://asharma.Test.com/Remedy1.xsl Here I am getting mo

Re: Help required.....about string/text manipulation

2003-06-15 Thread Rob Dixon
Anybody? Rob Chinku Simon wrote: > > > Mohit_jain01 wrote: > > > > > > > From: Rob Dixon > > > > > > > > Mohit_jain01 wrote: > > > > > > > > > > I am facing a problem with text file manipulation with Perl. > > > > > > > > > > I have a file with over 2 lac lines of data. > > > > > I need to find

Re: Help required.....about string/text manipulation

2003-06-14 Thread Chinku Simon
Hi, I wud like some help in assembling the kit. Thanks in Advance --- Rob Dixon <[EMAIL PROTECTED]> wrote: > Mohit_jain01 wrote: > > > > > From: Rob Dixon > > > > > > Mohit_jain01 wrote: > > > > > > > > I am facing a problem with text file manipulation with Perl. > > > > > > > > I have a file wi

Re: Help required.....about string/text manipulation

2003-06-14 Thread Rob Dixon
Mohit_jain01 wrote: > > > From: Rob Dixon > > > > Mohit_jain01 wrote: > > > > > > I am facing a problem with text file manipulation with Perl. > > > > > > I have a file with over 2 lac lines of data. > > > I need to find the duplicates(strings) in the file and copy those records into > > > another

RE: Help required.....about string/text manipulation

2003-06-13 Thread Mohit_Jain01
, Mohit -Original Message- From: Rob Dixon [mailto:[EMAIL PROTECTED] Sent: Sat 6/14/2003 3:39 AM To: [EMAIL PROTECTED] Cc: Subject: Re: Help required.about string/text manipulation Mohit_jain01 wrote

Re: Help required.....about string/text manipulation

2003-06-13 Thread Rob Dixon
Mohit_jain01 wrote: > Hi, > > I am facing a problem with text file manipulation with Perl. > > I have a file with over 2 lac lines of data. > I need to find the duplicates(strings) in the file and copy those records into > another file. > > Is there a function/module in Perl by which I can read t

Re: Help required

2003-03-31 Thread Scott R. Godin
Brijesh Kanderia wrote: > Hi All, > > I dont have very much idea about perl programing. I have writen a small > script which reads the content of one file which keeps on changing daily. > and sends the out put to the concerned person thru mail. > > Now what I want is that I dont want the content

Re: Help required

2003-03-30 Thread simran
Have a look at the MIME::Entity module on http://search.cpan.org/ Use that to build your message, and then one of the mail modules, or even sendmail to send the message. On Mon, 2003-03-31 at 16:49, Brijesh Kanderia wrote: > Hi All, > > I dont have very much idea about perl programing. I have

Re: Help Required : Coding Standards

2002-03-27 Thread Jonathan E. Paton
> Just need to know any good docs/web links for Coding > Standards In PERL. Any pointers are welcome. Style Guide: perldoc perlstyle Writing portable code: perldoc perlport Documentation index: perldoc perl Jonathan Paton __ Do You Y

Re: Help Required - Search and Replace

2002-03-21 Thread Jonathan E. Paton
> >my $word = "WORD"; > > > >while (<>) { > >s/$word/lie/g; #Slow > >} > > > >is slow because that $word forces the regex to > >be recompiled each time through. The best way > >to solve this problem is to create a Perl > >script on the fly and run using eval $script; > > Not true about that

Re: Help Required - Search and Replace

2002-03-21 Thread Jeff 'japhy' Pinyan
On Mar 21, Jonathan E. Paton said: >> I have a one big text file and also I have some >> set of strings to be replaced by another set of >> strings. Currently, I am reading each line of >> the file, and replacing one set of strings by >> another set of strings, one after another. Is >> there any

Re: Help Required - Search and Replace

2002-03-21 Thread Jonathan E. Paton
> I have a one big text file and also I have some > set of strings to be replaced by another set of > strings. Currently, I am reading each line of > the file, and replacing one set of strings by > another set of strings, one after another. Is > there any efficient way of doing this? The data > i

Re: Help Required - Search and Replace

2002-03-21 Thread Michael Stidham
my $new_file; open(FILE,') { $line=~s/WORD_TO_REPLACE/REPLACEMENT_WORD/g; $new_file.=$line; } close(FILE); open(FILE,'>new_file.txt') or die "Can't write new_file.txt: $!\n"; print FILE $new_file; close(FILE) I do something like this. Hope it helps >- Original Message - >From: "R

Re: Help Required - Search and Replace

2002-03-21 Thread Patrice Boisieau
Try this algorithm : Read the file (if you have sufficient memory to load it) Replace in each ligne Write the new lines P. Boisieau >From: Rajanikanth Dandamudi <[EMAIL PROTECTED]> >To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]> >Subject: Help Required - Search and Replace >Date: Thu, 21 Mar 20

Re: Help Required - Search and Replace

2002-03-21 Thread Patrice Boisieau
Try this algorithm : >From: Rajanikanth Dandamudi <[EMAIL PROTECTED]> >To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]> >Subject: Help Required - Search and Replace >Date: Thu, 21 Mar 2002 10:55:41 +0530 > >All, > >I have a one big text file and also I have some set of strings to be >replaced by

Re: Help Required - Search and Replace

2002-03-21 Thread Patrice Boisieau
Try this algorithm : >From: Rajanikanth Dandamudi <[EMAIL PROTECTED]> >To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]> >Subject: Help Required - Search and Replace >Date: Thu, 21 Mar 2002 10:55:41 +0530 > >All, > >I have a one big text file and also I have some set of strings to be >replaced by