Can you help here please?Input File(one.txt): Alias /ans_win/ "/ans/win/" Alias /icons/ "/ans/sttp/icons/" Alias /name/ "ans/name" Mycode: open(OH,">two.txt") or die "Could not write file two.txt"; open(FH,"one.txt") or die "Could not open file one.txt"; while(<FH>){ if (($_ =~ /Alias/) && ($_ =~ /icons/)){ print"Data=> $_\n"; }else{ print OH $_; } } close OH; close FH; $out = "mv two.txt one.txt"; system($out); My Expected output file: Alias /ans_win/ "/ans/win/" Alias /name/ "ans/name"
In reply to Remove a line from a file using perl one liner by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |