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
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
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
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
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;
>
$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
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
- 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
- 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
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
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.
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
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
13 matches
Mail list logo