![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| perl script for file processing | SEEHTAS | Shell Programming and Scripting | 10 | 03-25-2008 09:02 AM |
| processing a file with sed and awk | manouche | Shell Programming and Scripting | 4 | 10-11-2007 04:25 PM |
| Processing a CSV file | janemary.a | High Level Programming | 1 | 05-11-2007 06:27 AM |
| Have a shell script check for a file to exist before processing another file | heprox | Shell Programming and Scripting | 3 | 11-14-2006 03:26 AM |
| Processing a text file | TheCrunge | UNIX for Dummies Questions & Answers | 1 | 11-09-2005 11:47 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
File processing on perl
Hey everyone ...
I wanted to process the contents of a file, as in modify its contents. whats the best way to do it on perl? In more detail I hav to go through the contents of the file, match patterns n then modify the contents of the same file depending on the matching results. Any help is welcome. Thanks n regards, Garric |
|
||||
|
testfile.txt :
About Apple Apple is a fruit I like Apple Juice Code open(INFILE,"./testfile.txt")||die ("Cannot open testfile.txt"); open(OUTFILE,">./orange.txt")||die ("Cannot open orange.txt"); while($str=<INFILE>) { $str =~ s/Apple/Orange/g; print OUTFILE $str; } close(INFILE); close(OUTFILE); Orange.txt About Orange Orange is a fruit I like Orange Juice |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|