File1:
exclude1
exclude2
exclude3
File2 (dosya uzunlukta olabilir, bazen boş bir dosya değişir):
statement1 that has no excludes
statement2 that has exclude3
statement3 that has no excludes
statement4 that has no excludes
statement5 that has exclude1
statement6 that has exclude2
statement7 that has no excludes
çıkışı:
statement1 that has no excludes
statement3 that has no excludes
statement4 that has no excludes
statement7 that has no excludes
Scenerio2:
File1: (boş dosya)
empty file
File2:
statement1 that has no excludes
statement2 that has no excludes
statement3 that has no excludes
statement4 that has no excludes
çıkışı:
statement1 that has no excludes
statement2 that has no excludes
statement3 that has no excludes
statement4 that has no excludes
komut: Bu komut dosyası scenario1 için iyi çalışıyor
open (IN58, "<file2.txt") or die;
open (IN59, "<file1.txt") or die;
open (OUT42, ">output.txt") or die;
my @excludes = <IN59>;
chomp @excludes;
my $excludes = join ' |',@excludes;
while (<IN58>) {
next if /${excludes}/;
print OUT42 $_ ;
}
close (IN58);
close (IN59);
close (OUT42);
, ne zaman xclude dosyası (ör. file1) boş hale gelir, boş çıktı dosyası üretiyor ve istediğim gibi çalışmıyor. Koddaki herhangi bir düzeltme son derece yararlıdır.
Bu mantık diğer tasarımlar için işe yarıyor olsa da, kelimesi hariç tutulduğunda çalışma DFN1C1 ve File2 satırları aşağıdaki gibi tek satırda aşağıdaki gibidir); \ po [6] \: DFN1C1 bağlantı noktası haritası (D => \ po [5] _net_1 \, CLK => CLK16M_c, CLR => \ int_boardsel \, Q => \ po [6] _net_1); v13_D_9_pad: OUTBUF bağlantı noktası haritası (D => v13_D_9_c, PAD => v13_D_9); –
@sumathigokul regex'ten $ 'ı çıkarın ve deneyin, sonradan yayınlayın – mkHun