Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
TTMIS*1*1*sandbox*1*1*1*1*1*1*1 Joe Smith*1*1*sandbox*1*1*1*1*1*1*1 Company*1*1*sandbox*1*1*1*1*1*1*1 Travel*1*1*sandbox*1*1*1*1*1*1*1 Comerce*1*1*sandbox*1*1*1*1*1*1*1
my $ag = param("name");#a name comming from the form my $filename="template_data_test.txt"; my $template_data = "/cgi-bin\\content\\unsecure\\".$filename; open(DATA_IN, "$template_data") || print "Can't open output file1: $te +mplate_data\n"; while (<DATA_IN>) { $_ =~/^(.*?)\*(.*?)\*(.*?)\*(.*?)\*(.*?)\*(.*?)\*(.*?)\*(.*?)\ +*(.*?)\*(.*?)\*(.*?)$/; my $value1=$1; unless($value1 ne $ag) { s/$value1/$ag/g; # I might have a problem here cause it ch +anges every value of $value1 $save_list=$save_list.$_;}else{$save_list=$save_list.$ +_;} } open( DATA_OUT, ">>test2.txt" ) or die "$!\n"; print DATA_OUT "$save_list"; close DATA_IN; close DATA_OUT;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Text File Problem
by tachyon (Chancellor) on Nov 06, 2002 at 21:43 UTC | |
Re: Text File Problem
by buckaduck (Chaplain) on Nov 06, 2002 at 22:10 UTC | |
Re: Text File Problem
by sch (Pilgrim) on Nov 06, 2002 at 21:13 UTC |