Re: add text to the end of a word. HELP!!

2002-01-02 Thread John W. Krahn
Ahmed Moustafa wrote: > > I've tested reading and writing from the same file and it didn't work. I > think that can't be done in any language. Like I posted on Monday. :-) perl -pli -e's/$/\@minime.com/' yourfile.txt Also, read the entry for open() in the perlfunc document and the perlopent

RE: add text to the end of a word. HELP!!

2002-01-02 Thread John Edwards
e the new file to whatever the old one was called. HTH John -Original Message- From: Ahmed Moustafa [mailto:[EMAIL PROTECTED]] Sent: 02 January 2002 02:31 To: [EMAIL PROTECTED]; Leon Cc: [EMAIL PROTECTED] Subject: Re: add text to the end of a word. HELP!! Leon, I've tested r

Re: add text to the end of a word. HELP!!

2002-01-02 Thread Ahmed Moustafa
Leon, I've tested reading and writing from the same file and it didn't work. I think that can't be done in any language. Leon wrote: > - Original Message - > From: "Ahmed Moustafa" <[EMAIL PROTECTED]> > Newsgroups: perl.beginners > To: "Leon" <[EMAIL PROTECTED]> > Cc: <[EMAIL PROTECT

Re[2]: add text to the end of a word. HELP!!

2002-01-01 Thread Maxim Berlin
Hello Leon, Tuesday, January 01, 2002, Leon <[EMAIL PROTECTED]> wrote: >> Can you open a file for reading and writing as the same time? yes. L> I have asked the question of can I read and write to the same file L> simultaneously, such as this :- L> open FILE, 'myfile.txt' or die "$!\n"; L> open

Re: add text to the end of a word. HELP!!

2002-01-01 Thread Ahmed Moustafa
Can you open a file for reading and writing as the same time? Leon wrote: > There are many ways to do it. Some would use regexes or map. Anyway heres > one solution assuming your file contain only 1 word in one line.. > > open FILE, 'yourfile.txt' or die "$!\n"; > while (){ > chomp; >

Re: add text to the end of a word. HELP!!

2002-01-01 Thread shock
$name = $name . "\@minime.com"; * Peter Lemus ([EMAIL PROTECTED]) spake thusly: > Hi I need to add a word to the end of a word inside a > file. > > HELP PLEASE > > for example: I will read a file with these names > july > tony > richard > > then I want to add the following to the name > @mini

Re: add text to the end of a word. HELP!!

2002-01-01 Thread Prahlad Vaidyanathan
Hi, On Mon, 31 Dec 2001 Peter Lemus spewed into the ether: > Hi I need to add a word to the end of a word inside a > file. Correct me if i'm wrong, but isn't a tool like perl over-kill for this situation - why not just use sed ? pv. -- Prahlad Vaidyanathan <[EMAIL PROTECTED]> Fortune finishe

Re: add text to the end of a word. HELP!!

2001-12-31 Thread Leon
- Original Message - From: "Ahmed Moustafa" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: "Leon" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> > Can you open a file for reading and writing as the same time? I have asked the question of can I read and write to the same file simultaneou

Re: add text to the end of a word. HELP!!

2001-12-31 Thread Leon
- Original Message - From: "Peter Lemus" <[EMAIL PROTECTED]> > Hi I need to add a word to the end of a word inside a > file. > > HELP PLEASE > > for example: I will read a file with these names > july > tony > richard > > then I want to add the following to the name > @minime.com. So it

Re: add text to the end of a word. HELP!!

2001-12-31 Thread James Kelty
Assume that $file is the names file that you have. !/usr/bin/perl -w $file = qq(./file); $newfile = qq(./newfile); open FILE, "$file" or die "Cannot open file $file: $!\n"; open INFILE, ">$newfile" or die "Cannot open file $newfile: $!\n"; while () { chomp($_); s/(.*)/$1\@feathertrip\.net

Re: add text to the end of a word. HELP!!

2001-12-31 Thread John W. Krahn
Peter Lemus wrote: > > Hi I need to add a word to the end of a word inside a > file. > > for example: I will read a file with these names > july > tony > richard > > then I want to add the following to the name > @minime.com. So it will look like [EMAIL PROTECTED] perl -pli -e's/$/\@minime.

Re: add text to the end of a word. HELP!!

2001-12-31 Thread Bradford Ritchie
Wow! Your question sounds really urgent. Did you get talked into converting a contact database into a bulk email sender? I hate when that happens. Whether or not that's what you're doing, this should help: $email = $name . '@minime.com'; # i'm pretty sure this works Look up the '.' (dot) ope

add text to the end of a word. HELP!!

2001-12-31 Thread Peter Lemus
Hi I need to add a word to the end of a word inside a file. HELP PLEASE for example: I will read a file with these names july tony richard then I want to add the following to the name @minime.com. So it will look like [EMAIL PROTECTED] = Peter Lemus UNIX/NT Networks Engineer [EMAIL PROTE