in reply to Command Line
#!/usr/intel/bin/perl use warnings; use strict; my $find_flag; #using a flag variable my ($iFile, $oFile, $replacement) = @ARGV; open my $iHandle, '<', $iFile or die $@; open my $oHandle, '>', $oFile or die $@; while ( <$iHandle> ){ if (/^\S/){ #match a line that start wit +h no space if (/^\w+clk\[\d+\]/){ #match requested headline $find_flag = 0; } else{ $find_flag = 1; } } next if $find_flag and s/\s+QUALIFIED_CLOCK/$replacement/; #skip +s the line requested print $oHandle $_; #printing ordinary line }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Command Line
by guyov1 (Novice) on Oct 22, 2008 at 12:41 UTC | |
by guyov1 (Novice) on Oct 22, 2008 at 13:06 UTC | |
by holli (Abbot) on Oct 22, 2008 at 13:26 UTC | |
by guyov1 (Novice) on Oct 22, 2008 at 13:42 UTC | |
by ww (Archbishop) on Oct 22, 2008 at 13:25 UTC | |
by guyov1 (Novice) on Oct 22, 2008 at 13:39 UTC |