Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w $newdigit="+615"; $id="0001"; $line = `grep $id personel.txt`; ($id, $name, $family, $oldphone)=split(/\|/, $line); $newphone = $newdigit .$oldphone; $NewLine= join ("|",$id, $name, $family, $newphone); open(PERS,">>personel.txt"); while (<PERS>) { s/$line/$NewLine/; }
20030606 Edit by Corion: Changed title from "Substitue!"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Substitue!
by davorg (Chancellor) on Jun 06, 2003 at 08:02 UTC | |
by bart (Canon) on Jun 07, 2003 at 06:17 UTC | |
by Anonymous Monk on Jun 07, 2003 at 07:47 UTC | |
|
Re: Substitue!
by Corion (Patriarch) on Jun 06, 2003 at 08:00 UTC | |
|
Re: Substitue!
by arthas (Hermit) on Jun 06, 2003 at 08:04 UTC | |
by Skeeve (Parson) on Jun 06, 2003 at 08:06 UTC | |
|
Re: Substitution of text within a file
by linux454 (Pilgrim) on Jun 06, 2003 at 14:03 UTC | |
|
Re: Substitution of text within a file
by aquarium (Curate) on Jun 06, 2003 at 14:32 UTC | |
by Anonymous Monk on Jun 07, 2003 at 01:06 UTC |