My text file contains this type of lines. In first you can identify Date. I want to replace it with "18 May 2015" in the same file like
18 May 2015 <114319747011000001>,20150518230002,,917696706652,01,,52727,rch,,admin,,,,01,21314,,,,bulkpull2I am coming by step to step. When i am here it gives an error.
Error: Can't modify constant item in scalar assignment at date.pl line 1, near "10," Execution of date.pl aborted due to compilation errors.open(DATA,"<Pull-2015-5-18-23.txt"); my $find = "20150518"; my $replace = "18 May 2015"; while(my $line = <DATA>) { $line =~ s/$find/$replace/g; print $line; }
In reply to using s///g; by ravi45722
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |