Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: How should I Extract data from text file. Pattern I have to extract should not repeated one.

by Ovid (Cardinal)
on Feb 01, 2018 at 12:28 UTC ( #1208243=note: print w/replies, xml ) Need Help??


in reply to How should I Extract data from text file. Pattern I have to extract should not repeated one.

It looks like the pattern you're trying to extract is comprised of exactly seven characters, each of which can be a 1 (one), 0 (zero), or X. However, your sample output shows three results of six characters, so I'm a bit confused.

In any event, if it is seven characters, the pattern you're looking for is /([X01]{7})$/. It also sounds like you only want to skip repeating patterns for groups, not for the entire dataset. For any line which doesn't match that pattern, you want to do what is sometimes known as a "control break" where you reset your data and start again. Thus, if I've understood your requirements correctly, the following simple program shows one way it can be done.

#!/usr/bin/env perl use strict; use warnings; my %seen; while ( my $line = <DATA> ) { if ( $line =~ /([X01]{7})$/ ) { # line matched, so print the pattern if we've not seen it befo +re my $result = $1; next if $seen{$result}++; print "$result\n"; } else { # the line did not match, so clear our "seen" patterns %seen = (); } } __DATA__ Pattern 0 (full_sequential) Time 0: period = 100 Time 0: force_all_pis = XX00X1X Time 200: force_all_pis = XX1X0X1 Time 400: force_all_pis = XXX1XX0 Time 600: force_all_pis = XXX1XX0 Time 800: force_all_pis = XXX1XX0 Time 940: measure_all_pos =1 Pattern 1 (full_sequential) Time 0: period = 100 Time 0: force_all_pis = XX0XX1X Time 200: force_all_pis = XX1XXXX Time 400: force_all_pis = XX0X10X Time 600: force_all_pis = XX1XXXX Time 800: force_all_pis = XX0010X Time 1000: force_all_pis =XX110X1 Time 1140: measure_all_pos =1 Pattern 2 (full_sequential) Time 0: period = 100 Time 0: force_all_pis = XX00X11 Time 200: force_all_pis = XX110X0 Time 340: measure_all_pos =1 Pattern 3 (full_sequential) Time 0: period = 100 Time 0: force_all_pis = XX01X10 Time 200: force_all_pis = XX1X0X1 Time 400: force_all_pis = XX00011 Time 600: force_all_pis = XX1X0X1 Time 740: measure_all_pos =0 Pattern 4 (full_sequential) Time 0: period = 100 Time 0: force_all_pis = XX00X1X Time 200: force_all_pis = XX1XXXX Time 400: force_all_pis = XX010X1 Time 600: force_all_pis = XX10XX0 Time 740: measure_all_pos =0 Pattern 5 (full_sequential) Time 0: period = 100 Time 0: force_all_pis = XXXX0XX Time 200: force_all_pis = XXXX1XX Time 400: force_all_pis = XX0011X Time 600: force_all_pis = XX111X1 Time 740: measure_all_pos =1 Pattern 6 (full_sequential) Time 0: period = 100 Time 0: force_all_pis = XX0X10X Time 200: force_all_pis = XX1XXXX Time 400: force_all_pis = XX0XX1X Time 600: force_all_pis = XX1XXXX Time 800: force_all_pis = XX00X1X Time 1000: force_all_pis =XX110X1 Time 1140: measure_all_pos =0 Pattern 7 (full_sequential) Time 0: period = 100 Time 0: force_all_pis = XXXX1XX Time 200: force_all_pis = XXXX0XX Time 400: force_all_pis = XX0001X Time 600: force_all_pis = XX110X1 Time 740: measure_all_pos =0 Pattern 8 (full_sequential) Time 0: period = 100 Time 0: force_all_pis = XX00X1X Time 200: force_all_pis = XX11XXX Time 400: force_all_pis = XX010X1 Time 600: force_all_pis = XX11XX0 Time 740: measure_all_pos =1 Pattern 9 (full_sequential) Time 0: period = 100 Time 0: force_all_pis = XX00X1X Time 200: force_all_pis = XX11XX0 Time 400: force_all_pis = XX0X0X1 Time 600: force_all_pis = XX1XXXX Time 800: force_all_pis = XXX0XX0 Time 940: measure_all_pos =0

And with that, your output is:

XX1X0X1 XXX1XX0 XX0XX1X XX1XXXX XX0X10X XX0010X XX110X1 XX00X11 XX110X0 XX01X10 XX1X0X1 XX00011 XX00X1X XX1XXXX XX010X1 XX10XX0 XXXX0XX XXXX1XX XX0011X XX111X1 XX0X10X XX1XXXX XX0XX1X XX00X1X XX110X1 XXXX1XX XXXX0XX XX0001X XX110X1 XX00X1X XX11XXX XX010X1 XX11XX0 XX00X1X XX11XX0 XX0X0X1 XX1XXXX XXX0XX0
  • Comment on Re: How should I Extract data from text file. Pattern I have to extract should not repeated one.
  • Select or Download Code

Replies are listed 'Best First'.
Re^2: How should I Extract data from text file. Pattern I have to extract should not repeated one.
by jumdesumit (Novice) on Feb 01, 2018 at 12:46 UTC

    Yes you are right. But I need one more help should I write this output into another text file.

      But I need one more help should I write this output into another text file.

      How to print to a file instead of standard output is covered in Files and I/O in perlintro.

      Yes you are right.

      I assume this refers to incorrect output example data given in the OP. If this is the case, you should correct the OP yourself. Please see How do I change/delete my post?


      Give a man a fish:  <%-{-{-{-<

Re^2: How should I Extract data from text file. Pattern I have to extract should not repeated one.
by jumdesumit (Novice) on Feb 04, 2018 at 12:56 UTC

    Why this code is not giving output for this file. Even I changed this line

    Change in code "if ( $line =~ /([N01]{39})$/ )"
    FILE:- STIL 1.0 { Design 2005; } Header { Title " TetraMAX(R) K-2015.06-SP2-i150831_132851 STIL output"; Date "Sun Feb 4 16:53:01 2018"; Source " TetraMAX(R) K-2015.06-SP2-i150831_132851 STIL output"; History { Ann {* Incoming_Date "Sun Feb 4 16:51:16 2018" *} Ann {* Collapsed Transition Fault Summary Report *} Ann {* ----------------------------------------------- *} Ann {* fault class code #faults *} Ann {* ------------------------------ ---- --------- *} Ann {* Detected DT 64 *} Ann {* Possibly detected PT 2 *} Ann {* Undetectable UD 33 *} Ann {* ATPG untestable AU 3059 *} Ann {* Not detected ND 0 *} Ann {* ----------------------------------------------- *} Ann {* total faults 3158 *} Ann {* test coverage 2.08% *} Ann {* ----------------------------------------------- *} Ann {* *} Ann {* Pattern Summary Report *} Ann {* ----------------------------------------------- *} Ann {* #internal patterns 37 *} Ann {* #full_sequential patterns 37 *} Ann {* ----------------------------------------------- *} Ann {* *} Ann {* rule severity #fails description *} Ann {* ---- -------- ------ --------------------------------- + *} Ann {* N20 warning 1 underspecified UDP *} Ann {* B8 warning 11 unconnected module input pin *} Ann {* B9 warning 2 undriven module internal net *} Ann {* B10 warning 147 unconnected module internal net * +} Ann {* C3 warning 145 no latch transparency when clocks + off *} Ann {* C16 warning 145 nonscan cell port unable to captu +re *} Ann {* *} Ann {* clock_name off usage *} Ann {* ---------------- --- -------------------------- *} Ann {* CK 0 *} Ann {* *} Ann {* There are no constraint ports *} Ann {* There are no equivalent pins *} Ann {* There are no net connections *} Ann {* top_module_name = s9234 *} Ann {* Unified STIL Flow *} Ann {* serial_flag = 1 *} } } Signals { "GND" In; "VDD" In; "CK" In; "g102" In; "g107" In; "g22" In; "g23" +In; "g301" In; "g306" In; "g310" In; "g314" In; "g319" In; "g32" In; "g36" In; "g3 +7" In; "g38" In; "g39" In; "g40" In; "g41" In; "g42" In; "g44" In; "g45" In; "g46" I +n; "g47" In; "g557" In; "g558" In; "g559" In; "g560" In; "g561" In; "g562" In; " +g563" In; "g564" In; "g567" In; "g639" In; "g702" In; "g705" In; "g89" In; "g94" In; "g9 +8" In; "g1290" Out; "g1293" Out; "g2584" Out; "g3222" Out; "g3600" Out; "g4098" Out; "g +4099" Out; "g4100" Out; "g4101" Out; "g4102" Out; "g4103" Out; "g4104" Out; "g4105" Out; "g +4106" Out; "g4107" Out; "g4108" Out; "g4109" Out; "g4110" Out; "g4112" Out; "g4121" Out; "g +4307" Out; "g4321" Out; "g4422" Out; "g4809" Out; "g5137" Out; "g5468" Out; "g5469" Out; "g +5692" Out; "g6282" Out; "g6284" Out; "g6360" Out; "g6362" Out; "g6364" Out; "g6366" Out; "g +6368" Out; "g6370" Out; "g6372" Out; "g6374" Out; "g6728" Out; } SignalGroups { "_pi" = '"GND" + "VDD" + "CK" + "g102" + "g107" + "g22" + "g23" + " +g301" + "g306" + "g310" + "g314" + "g319" + "g32" + "g36" + "g37" + "g38" + + "g39" + "g40" + "g41" + "g42" + "g44" + "g45" + "g46" + "g47" + "g557" + "g +558" + "g559" + "g560" + "g561" + "g562" + "g563" + "g564" + "g567" + "g63 +9" + "g702" + "g705" + "g89" + "g94" + "g98"' { WFCMap { 0X->0; 1X->1; Z +X->Z; NX->N; ZH->H; ZL->L; ZT->T; 1Z->1; 0Z->0; } } // #signals=39 "_in" = '"GND" + "VDD" + "CK" + "g102" + "g107" + "g22" + "g23" + " +g301" + "g306" + "g310" + "g314" + "g319" + "g32" + "g36" + "g37" + "g38" + + "g39" + "g40" + "g41" + "g42" + "g44" + "g45" + "g46" + "g47" + "g557" + "g +558" + "g559" + "g560" + "g561" + "g562" + "g563" + "g564" + "g567" + "g63 +9" + "g702" + "g705" + "g89" + "g94" + "g98"'; // #signals=39 "_po" = '"g1290" + "g1293" + "g2584" + "g3222" + "g3600" + "g4098" ++ "g4099" + "g4100" + "g4101" + "g4102" + "g4103" + "g4104" + "g4105" + "g4106" + + "g4107" + "g4108" + "g4109" + "g4110" + "g4112" + "g4121" + "g4307" + "g4321" + + "g4422" + "g4809" + "g5137" + "g5468" + "g5469" + "g5692" + "g6282" + "g6284" + + "g6360" + "g6362" + "g6364" + "g6366" + "g6368" + "g6370" + "g6372" + "g6374" + + "g6728"' { WFCMap { 0X->0; 1X->1; ZX->Z; NX->N; ZH->H; ZL->L; ZT->T; 1Z->1; +0Z->0; } } // #signals=39 "_out" = '"g1290" + "g1293" + "g2584" + "g3222" + "g3600" + "g4098" + + "g4099" + "g4100" + "g4101" + "g4102" + "g4103" + "g4104" + "g4105" + "g4106" + + "g4107" + "g4108" + "g4109" + "g4110" + "g4112" + "g4121" + "g4307" + "g4321" + + "g4422" + "g4809" + "g5137" + "g5468" + "g5469" + "g5692" + "g6282" + "g6284" + + "g6360" + "g6362" + "g6364" + "g6366" + "g6368" + "g6370" + "g6372" + "g6374" + + "g6728"'; // #signals=39 "_default_In_Timing_" = '"GND" + "VDD" + "CK" + "g102" + "g107" + " +g22" + "g23" + "g301" + "g306" + "g310" + "g314" + "g319" + "g32" + "g36" ++ "g37" + "g38" + "g39" + "g40" + "g41" + "g42" + "g44" + "g45" + "g46" + "g4 +7" + "g557" + "g558" + "g559" + "g560" + "g561" + "g562" + "g563" + "g56 +4" + "g567" + "g639" + "g702" + "g705" + "g89" + "g94" + "g98"'; // #sig +nals=39 "_default_Out_Timing_" = '"g1290" + "g1293" + "g2584" + "g3222" + " +g3600" + "g4098" + "g4099" + "g4100" + "g4101" + "g4102" + "g4103" + "g4104" + + "g4105" + "g4106" + "g4107" + "g4108" + "g4109" + "g4110" + "g4112" + "g4121" + + "g4307" + "g4321" + "g4422" + "g4809" + "g5137" + "g5468" + "g5469" + "g5692" + + "g6282" + "g6284" + "g6360" + "g6362" + "g6364" + "g6366" + "g6368" + "g6370" + + "g6372" + "g6374" + "g6728"'; // #signals=39 "_default_Clk0_Timing_" = '"CK"'; // #signals=1 } Timing { WaveformTable "_default_WFT_" { Period '100ns'; Waveforms { "_default_In_Timing_" { 0 { '0ns' D; } } "_default_In_Timing_" { 1 { '0ns' U; } } "_default_In_Timing_" { Z { '0ns' Z; } } "_default_In_Timing_" { N { '0ns' N; } } "_default_Clk0_Timing_" { P { '0ns' D; '50ns' U; '80ns' D; } +} "_default_Out_Timing_" { X { '0ns' Z; } } "_default_Out_Timing_" { H { '0ns' Z; '40ns' H; } } "_default_Out_Timing_" { L { '0ns' Z; '40ns' L; } } "_default_Out_Timing_" { T { '0ns' Z; '40ns' T; } } } } } ScanStructures { // Uncomment and modify the following to suit your design // ScanChain "chain_name" { ScanIn "chain_input_name"; ScanOut "cha +in_output_name"; } } PatternBurst "_burst_" { PatList { "_pattern_" { } }} PatternExec { PatternBurst "_burst_"; } Procedures { "multiclock_capture" { W "_default_WFT_"; C { "VDD"=0; "g319"=0; "g314"=0; "g5692"=X; "g310"=0; "g4422"=X; + "g2584"=X; "g6368"=X; "g6366"=X; "g6364"=X; "g6362"=X; "g6360"=X; "g6284"=X; "g4099"=X; "g6282"=X; "g4098 +"=X; "g6374"=X; "g6372"=X; "g6370"=X; "g6728"=X; "g3600"=X; "g89"=0; "g5469"=X; "g5468"=X; "g4109"= +X; "g4108"=X; "g4107"=X; "g4106"=X; "g4105"=X; "g4104"=X; "g4103"=X; "g4102"=X; "g4101"=X; "g4100 +"=X; "g98"=0; "g94"=0; "g4809"=X; "g705"=0; "g702"=0; "g4112"=X; "g4110"=X; "g107"=0; "g5137"=X; "g102"=0 +; "g4121"=X; "g639"=0; "g4307"=X; "g23"=0; "g22"=0; "CK"=0; "g559"=0; "GND"=0; "g558"=0; "g557"=0; "g39" +=0; "g38"=0; "g37"=0; "g36"=0; "g32"=0; "g567"=0; "g564"=0; "g563"=0; "g562"=0; "g561"=0; "g1293"=X; "g560"=0; +"g1290"=X; "g3222"=X; "g306"=0; "g47"=0; "g46"=0; "g45"=0; "g44"=0; "g301"=0; "g42"=0; "g41"=0; "g40"= +0; "g4321"=X; } V { "_pi"=\j \r39 # ; "_po"=\j \r39 # ; } } "allclock_capture" { W "_default_WFT_"; C { "VDD"=0; "g319"=0; "g314"=0; "g5692"=X; "g310"=0; "g4422"=X; + "g2584"=X; "g6368"=X; "g6366"=X; "g6364"=X; "g6362"=X; "g6360"=X; "g6284"=X; "g4099"=X; "g6282"=X; "g4098 +"=X; "g6374"=X; "g6372"=X; "g6370"=X; "g6728"=X; "g3600"=X; "g89"=0; "g5469"=X; "g5468"=X; "g4109"= +X; "g4108"=X; "g4107"=X; "g4106"=X; "g4105"=X; "g4104"=X; "g4103"=X; "g4102"=X; "g4101"=X; "g4100 +"=X; "g98"=0; "g94"=0; "g4809"=X; "g705"=0; "g702"=0; "g4112"=X; "g4110"=X; "g107"=0; "g5137"=X; "g102"=0 +; "g4121"=X; "g639"=0; "g4307"=X; "g23"=0; "g22"=0; "CK"=0; "g559"=0; "GND"=0; "g558"=0; "g557"=0; "g39" +=0; "g38"=0; "g37"=0; "g36"=0; "g32"=0; "g567"=0; "g564"=0; "g563"=0; "g562"=0; "g561"=0; "g1293"=X; "g560"=0; +"g1290"=X; "g3222"=X; "g306"=0; "g47"=0; "g46"=0; "g45"=0; "g44"=0; "g301"=0; "g42"=0; "g41"=0; "g40"= +0; "g4321"=X; } V { "_pi"=\j \r39 # ; "_po"=\j \r39 # ; } } "allclock_launch" { W "_default_WFT_"; C { "VDD"=0; "g319"=0; "g314"=0; "g5692"=X; "g310"=0; "g4422"=X; + "g2584"=X; "g6368"=X; "g6366"=X; "g6364"=X; "g6362"=X; "g6360"=X; "g6284"=X; "g4099"=X; "g6282"=X; "g4098 +"=X; "g6374"=X; "g6372"=X; "g6370"=X; "g6728"=X; "g3600"=X; "g89"=0; "g5469"=X; "g5468"=X; "g4109"= +X; "g4108"=X; "g4107"=X; "g4106"=X; "g4105"=X; "g4104"=X; "g4103"=X; "g4102"=X; "g4101"=X; "g4100 +"=X; "g98"=0; "g94"=0; "g4809"=X; "g705"=0; "g702"=0; "g4112"=X; "g4110"=X; "g107"=0; "g5137"=X; "g102"=0 +; "g4121"=X; "g639"=0; "g4307"=X; "g23"=0; "g22"=0; "CK"=0; "g559"=0; "GND"=0; "g558"=0; "g557"=0; "g39" +=0; "g38"=0; "g37"=0; "g36"=0; "g32"=0; "g567"=0; "g564"=0; "g563"=0; "g562"=0; "g561"=0; "g1293"=X; "g560"=0; +"g1290"=X; "g3222"=X; "g306"=0; "g47"=0; "g46"=0; "g45"=0; "g44"=0; "g301"=0; "g42"=0; "g41"=0; "g40"= +0; "g4321"=X; } V { "_pi"=\j \r39 # ; "_po"=\j \r39 # ; } } "allclock_launch_capture" { W "_default_WFT_"; C { "VDD"=0; "g319"=0; "g314"=0; "g5692"=X; "g310"=0; "g4422"=X; + "g2584"=X; "g6368"=X; "g6366"=X; "g6364"=X; "g6362"=X; "g6360"=X; "g6284"=X; "g4099"=X; "g6282"=X; "g4098 +"=X; "g6374"=X; "g6372"=X; "g6370"=X; "g6728"=X; "g3600"=X; "g89"=0; "g5469"=X; "g5468"=X; "g4109"= +X; "g4108"=X; "g4107"=X; "g4106"=X; "g4105"=X; "g4104"=X; "g4103"=X; "g4102"=X; "g4101"=X; "g4100 +"=X; "g98"=0; "g94"=0; "g4809"=X; "g705"=0; "g702"=0; "g4112"=X; "g4110"=X; "g107"=0; "g5137"=X; "g102"=0 +; "g4121"=X; "g639"=0; "g4307"=X; "g23"=0; "g22"=0; "CK"=0; "g559"=0; "GND"=0; "g558"=0; "g557"=0; "g39" +=0; "g38"=0; "g37"=0; "g36"=0; "g32"=0; "g567"=0; "g564"=0; "g563"=0; "g562"=0; "g561"=0; "g1293"=X; "g560"=0; +"g1290"=X; "g3222"=X; "g306"=0; "g47"=0; "g46"=0; "g45"=0; "g44"=0; "g301"=0; "g42"=0; "g41"=0; "g40"= +0; "g4321"=X; } V { "_pi"=\j \r39 # ; "_po"=\j \r39 # ; } } // Uncomment and modify the following to suit your design // load_unload { // V { "CK" = 0; } // force clocks off and scan enable pins acti +ve // Shift { V { _si=#; _so=#; "CK" = P; }} // pulse shift clocks // } } MacroDefs { "test_setup" { W "_default_WFT_"; V { "CK"=0; } } } Pattern "_pattern_" { W "_default_WFT_"; "precondition all Signals": C { "_pi"=\r39 0 ; "_po"=\r39 X ; } Macro "test_setup"; Ann {* full_sequential *} Call "multiclock_capture" { "_pi"=NN0NNNNNNNNNNN0NNNNNNNNNNNNNNNNNNNNNNNN; } Call "allclock_launch_capture" { "_pi"=NN0NNNNNNNNNNN1NNNNNNNNNNNNNNNNNNNNNNNN; "_po"=XXXXXXXXHXX +XXXXXXXXXXXXXXXXLXXXXXXXXXXL; } Ann {* full_sequential *} Call "multiclock_capture" { "_pi"=NN0NNNNNNNNNNN1NNNNNNNNNNNNNNNNNNNNNNNN; } Call "allclock_launch_capture" { "_pi"=NN0NNNNNNNNNNN0NNNNNNNNNNNNNNNNNNNNNNNN; "_po"=XXXXXXXXLXX +XXXXXXXXXXXXXXXXLXXXXXXXXXXL; } Ann {* full_sequential *} Call "multiclock_capture" { "_pi"=NN0NNNNNNNNNNNNNNNNN0NNNNNNNNNNNNNNNNNN; } Call "allclock_launch_capture" { "_pi"=NN0NNNNNNNNNNNNNNNNN1NNNNNNNNNNNNNNNNNN; "_po"=XXXXXXXXXXX +XXXHXXXXXXXXXXXXLXXXXXXXXXXL; } Ann {* full_sequential *} Call "multiclock_capture" { "_pi"=NN0NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN0NN; } Call "allclock_launch_capture" { "_pi"=NN00NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN1NN; "_po"=XXHXXXXXXXX +XXXXXXXXXXXXXXXXLXXXXXXXXXXL; } Ann {* full_sequential *} Call "multiclock_capture" { "_pi"=NN0NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN0NNN; } Call "allclock_launch_capture" { "_pi"=NN0NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN1NNN; "_po"=XXXHXXXXXXX +XXXXXXXXXXXXXXXXLXXXXXXXXXXL; } Ann {* full_sequential *} Call "multiclock_capture" { "_pi"=NN0NNNNNNNNNN0NNNNNNNNNNNNNNNNNNNNNNNNN; } Call "allclock_launch_capture" { "_pi"=NN0NNNNNNNNNN1NNNNNNNNNNNNNNNNNNNNNNNNN; "_po"=XXXXXXXHXXX +XXXXXXXXXXXXXXXXLXXXXXXXXXXL; } Ann {* full_sequential *} Call "multiclock_capture" { "_pi"=NN0NNNNNNNNNNNNN0NNNNNNNNNNNNNNNNNNNNNN; } Call "allclock_launch_capture" { "_pi"=NN0NNNNNNNNNNNNN1NNNNNNNNNNNNNNNNNNNNNN; "_po"=XXXXXXXXXXH +XXXXXXXXXXXXXXXXLXXXXXXXXXXL; } Ann {* full_sequential *} Call "multiclock_capture" { "_pi"=NN0NNNNNNNNNNNNNNNNNNN0NNNNNNNNNNNNNNNN; } Call "allclock_launch_capture" { "_pi"=NN0NNNNNNNNNNNNNNNNNNN1NNNNNNNNNNNNNNNN; "_po"=XXXXXXXXXXX +XXXXXHXXXXXXXXXXLXXXXXXXXXXL; } Ann {* full_sequential *} Call "multiclock_capture" { "_pi"=NN0NNNNNNNNNNNNNNNN0NNNNNNNNNNNNNNNNNNN; } Call "allclock_launch_capture" { "_pi"=NN0NNNNNNNNNNNNNNNN1NNNNNNNNNNNNNNNNNNN; "_po"=XXXXXXXXXXX +XXHXXXXXXXXXXXXXLXXXXXXXXXXL; } Ann {* full_sequential *} Call "multiclock_capture" { "_pi"=NN0NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN1NN; } Call "allclock_launch_capture" { "_pi"=NN00NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN0NN; "_po"=XXLXXXXXXXX +XXXXXXXXXXXXXXXXLXXXXXXXXXXL; } Ann {* full_sequential *} Call "multiclock_capture" { "_pi"=NN0NNNNNNNNNNNNNNN1NNNNNNNNNNNNNNNNNNNN; } Call "allclock_launch_capture" { "_pi"=NN0NNNNNNNNNNNNNNN0NNNNNNNNNNNNNNNNNNNN; "_po"=XXXXXXXXXXX +XXXXXXLXXXXXXXXXLXHHHHHHHHHL; } Ann {* full_sequential *} Call "multiclock_capture" { "_pi"=NN0NNNNNNNNN1NNNNNNNNNNNNNNNNNNNNNNNNNN; } Call "allclock_launch_capture" { "_pi"=NN0NNNNNNNNN0NNNNNNNNNNNNNNNNNNNNNNNNNN; "_po"=XXXXXXLXXXX +XXXXXXXXXXXXXXXXLXXXXXXXXXXL; } Ann {* full_sequential *} Call "multiclock_capture" { "_pi"=NN0NNNNNNNNNNNNNNNN1NNNNNNNNNNNNNNNNNNN; } Call "allclock_launch_capture" { "_pi"=NN0NNNNNNNNNNNNNNNN0NNNNNNNNNNNNNNNNNNN; "_po"=XXXXXXXXXXX +XXLXXXXXXXXXXXXXLXXXXXXXXXXL; } Ann {* full_sequential *} Call "multiclock_capture" { "_pi"=NN0NNNNNNNNNNNNNNN0NNNNNNNNNNNNNNNNNNNN; } Call "allclock_launch_capture" { "_pi"=NN0NNNNNNNNNNNNNNN1NNNNNNNNNNNNNNNNNNNN; "_po"=XXXXXXXXXXX +XXXXXXHXXXXXXXXXLXXXXXXXXXXL; } Ann {* full_sequential *} Call "multiclock_capture" { "_pi"=NN0NNNNNNNNNNNN0NNNNNNNNNNNNNNNNNNNNNNN; } Call "allclock_launch_capture" { "_pi"=NN0NNNNNNNNNNNN1NNNNNNNNNNNNNNNNNNNNNNN; "_po"=XXXXXXXXXHX +XXXXXXXXXXXXXXXXLXXXXXXXXXXL; } Ann {* full_sequential *} Call "multiclock_capture" { "_pi"=NN00NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN1NN; } Call "allclock_launch_capture" { "_pi"=NN01NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN; "_po"=XXLXXXXXXXX +XXXXXXXXXXXXXXXXLXXXXXXXXXXL; } Ann {* full_sequential *} Call "multiclock_capture" { "_pi"=NN00NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN; } Call "allclock_launch_capture" { "_pi"=NN01NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN1NN; "_po"=XXLXXXXXXXX +XXXXXXXXXXXXXXXXLXXXXXXXXXXL; } Ann {* full_sequential *} Call "multiclock_capture" { "_pi"=NN01NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN; } Call "allclock_launch_capture" { "_pi"=NN00NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN1NN; "_po"=XXHXXXXXXXX +XXXXXXXXXXXXXXXXLXXXXXXXXXXL; } Ann {* full_sequential *} Call "multiclock_capture" { "_pi"=NN0NN0NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN; } Call "allclock_launch_capture" { "_pi"=NN0NN1NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN; "_po"=XXXXXXXXXXX +HXXXXXXXXXXXXXXXLHHHHHHHHHHL; } Ann {* full_sequential *} Call "multiclock_capture" { "_pi"=NN0NN1NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN; } Call "allclock_launch_capture" { "_pi"=NN0NN0NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN; "_po"=XXXXXXXXXXX +LXXXXXXXXXXXXXXXLXXXXXXXXXXL; } Ann {* full_sequential *} Call "multiclock_capture" { "_pi"=NN0NNN0NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN; } Call "allclock_launch_capture" { "_pi"=NN0NNN1NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN; "_po"=XXXXXHXXXXX +XXXXXXXXXXXXXXXXLXXXXXXXXXXL; } Ann {* full_sequential *} Call "multiclock_capture" { "_pi"=NN0NNN1NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN; } Call "allclock_launch_capture" { "_pi"=NN0NNN0NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN; "_po"=XXXXXLXXXXX +XXXXXXXXXXXXXXXXLXXXXXXXXXXL; } Ann {* full_sequential *} Call "multiclock_capture" { "_pi"=NN0NNNNNNNNN0NNNNNNNNNNNNNNNNNNNNNNNNNN; } Call "allclock_launch_capture" { "_pi"=NN0NNNNNNNNN1NNNNNNNNNNNNNNNNNNNNNNNNNN; "_po"=XXXXXXHXXXX +XXXXXXXXXXXXXXXXLXXXXXXXXXXL; } Ann {* full_sequential *} Call "multiclock_capture" { "_pi"=NN0NNNNNNNNNN1NNNNNNNNNNNNNNNNNNNNNNNNN; } Call "allclock_launch_capture" { "_pi"=NN0NNNNNNNNNN0NNNNNNNNNNNNNNNNNNNNNNNNN; "_po"=XXXXXXXLXXX +XXXXXXXXXXXXXXXXLXXXXXXXXXXL; } Ann {* full_sequential *} Call "multiclock_capture" { "_pi"=NN0NNNNNNNNNNNN1NNNNNNNNNNNNNNNNNNNNNNN; } Call "allclock_launch_capture" { "_pi"=NN0NNNNNNNNNNNN0NNNNNNNNNNNNNNNNNNNNNNN; "_po"=XXXXXXXXXLX +XXXXXXXXXXXXXXXXLXXXXXXXXXXL; } Ann {* full_sequential *} Call "multiclock_capture" { "_pi"=NN0NNNNNNNNNNNNN1NNNNNNNNNNNNNNNNNNNNNN; } Call "allclock_launch_capture" { "_pi"=NN0NNNNNNNNNNNNN0NNNNNNNNNNNNNNNNNNNNNN; "_po"=XXXXXXXXXXL +XXXXXXXXXXXXXXXXLXXXXXXXXXXL; } Ann {* full_sequential *} Call "multiclock_capture" { "_pi"=NN0NNNNNNNNNNNNNN0NNNNNNNNNNNNNNNNNNNNN; } Call "allclock_launch_capture" { "_pi"=NN0NNNNNNNNNNNNNN1NNNNNNNNNNNNNNNNNNNNN; "_po"=XXXXXXXXXXX +XHXXXXXXXXXXXXXXLXXXXXXXXXXL; } Ann {* full_sequential *} Call "multiclock_capture" { "_pi"=NN0NNNNNNNNNNNNNN1NNNNNNNNNNNNNNNNNNNNN; } Call "allclock_launch_capture" { "_pi"=NN0NNNNNNNNNNNNNN0NNNNNNNNNNNNNNNNNNNNN; "_po"=XXXXXXXXXXX +XLXXXXXXXXXXXXXXLXXXXXXXXXXL; } Ann {* full_sequential *} Call "multiclock_capture" { "_pi"=NN0NNNNNNNNNNNNNNNNN1NNNNNNNNNNNNNNNNNN; } Call "allclock_launch_capture" { "_pi"=NN0NNNNNNNNNNNNNNNNN0NNNNNNNNNNNNNNNNNN; "_po"=XXXXXXXXXXX +XXXLXXXXXXXXXXXXLXXXXXXXXXXL; } Ann {* full_sequential *} Call "multiclock_capture" { "_pi"=NN0NNNNNNNNNNNNNNNNNN0NNNNNNNNNNNNNNNNN; } Call "allclock_launch_capture" { "_pi"=NN0NNNNNNNNNNNNNNNNNN1NNNNNNNNNNNNNNNNN; "_po"=XXXXXXXXXXX +XXXXHXXXXXXXXXXXLXXXXXXXXXXL; } Ann {* full_sequential *} Call "multiclock_capture" { "_pi"=NN0NNNNNNNNNNNNNNNNNN1NNNNNNNNNNNNNNNNN; } Call "allclock_launch_capture" { "_pi"=NN0NNNNNNNNNNNNNNNNNN0NNNNNNNNNNNNNNNNN; "_po"=XXXXXXXXXXX +XXXXLXXXXXXXXXXXLXXXXXXXXXXL; } Ann {* full_sequential *} Call "multiclock_capture" { "_pi"=NN0NNNNNNNNNNNNNNNNNNN1NNNNNNNNNNNNNNNN; } Call "allclock_launch_capture" { "_pi"=NN0NNNNNNNNNNNNNNNNNNN0NNNNNNNNNNNNNNNN; "_po"=XXXXXXXXXXX +XXXXXLXXXXXXXXXXLXXXXXXXXXXL; } Ann {* full_sequential *} Call "multiclock_capture" { "_pi"=NN0NNNNNNNNNNNNNNNNNNNN0NNNNNNNNNNNNNNN; } Call "allclock_launch_capture" { "_pi"=NN0NNNNNNNNNNNNNNNNNNNN1NNNNNNNNNNNNNNN; "_po"=XXXXXXXXXXX +XXXXXXXHXXXXXXXXLXXXXXXXXXXL; } Ann {* full_sequential *} Call "multiclock_capture" { "_pi"=NN0NNNNNNNNNNNNNNNNNNNN1NNNNNNNNNNNNNNN; } Call "allclock_launch_capture" { "_pi"=NN0NNNNNNNNNNNNNNNNNNNN0NNNNNNNNNNNNNNN; "_po"=XXXXXXXXXXX +XXXXXXXLXXXXXXXXLXXXXXXXXXXL; } Ann {* full_sequential *} Call "multiclock_capture" { "_pi"=NN0NNNNNNNNNNNNNNNNNNNNNNNNNNNN0NNNNNNN; } Call "allclock_launch_capture" { "_pi"=NN0NNNNNNNNNNNNNNNNNNNNNNNNNNNN1NNNNNNN; "_po"=XXXXXXXXXXX +XXXXXXXXXXXHXXXXLXXXXXXXXXXL; } Ann {* full_sequential *} Call "multiclock_capture" { "_pi"=NN0NNNNNNNNNNNNNNNNNNNNNNNNNNNN1NNNNNNN; } Call "allclock_launch_capture" { "_pi"=NN0NNNNNNNNNNNNNNNNNNNNNNNNNNNN0NNNNNNN; "_po"=XXXXXXXXXXX +XXXXXXXXXXXLXXXXLXXXXXXXXXXL; } Ann {* full_sequential *} Call "multiclock_capture" { "_pi"=NN0NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN1NNN; } Call "allclock_launch_capture" { "_pi"=NN0NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN0NNN; "_po"=XXXLXXXXXXX +XXXXXXXXXXXXXXXXLXXXXXXXXXXL; } } // Patterns reference 75 V statements, generating 75 test cycles

      jumdesumit:

      Well, while you have several lines that match the pattern ([N01]{39}), none of the lines stop after the last [N01] match, they all have a semicolon and more text after them.

      Try changing the line to not require that the line end immediately after that, like this:

      if ( $line =~ /([N01]{39})/ )

      or alternatively, specify that the string should be followed with a semicolon:

      if ( $line =~ /([N01]{39});/ )

      It would be helpful if you'd re-read perldoc perlre and verify that your expressions are saying what you really mean.

      When I have a problem with a pattern, I usually do something akin to putting this at the start of the file:

      use strict; use warnings; while (my $line = <DATA>) { if ($line =~ /([N01]{39})$/) { print "line $.: <$1>\n"; } } __DATA__

      And then run the file as a perl script. Then you can tweak your regex until you get what you're looking for. For example, when I ran it with the above bit of code on the front, I got this:

      Roboticus@Waubli ~ $ perl pm1208422.pl Roboticus@Waubli ~ $

      I then removed the '$' from your condition, re-ran it and got:

      Roboticus@Waubli ~ $ perl pm1208422.pl line 194: <NN0NNNNNNNNNNN0NNNNNNNNNNNNNNNNNNNNNNNN> line 196: <NN0NNNNNNNNNNN1NNNNNNNNNNNNNNNNNNNNNNNN> line 199: <NN0NNNNNNNNNNN1NNNNNNNNNNNNNNNNNNNNNNNN> line 201: <NN0NNNNNNNNNNN0NNNNNNNNNNNNNNNNNNNNNNNN> line 204: <NN0NNNNNNNNNNNNNNNNN0NNNNNNNNNNNNNNNNNN> line 206: <NN0NNNNNNNNNNNNNNNNN1NNNNNNNNNNNNNNNNNN> line 209: <NN0NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN0NN> line 211: <NN00NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN1NN> line 214: <NN0NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN0NNN> line 216: <NN0NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN1NNN> . . . et cetera . . .

      Update: Fixed wording and formatting (code tags so square brackets don't linkify) in first sentence.

      ...roboticus

      When your only tool is a hammer, all problems look like your thumb.

        Thank you so much for your help.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1208243]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2020-10-24 03:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (242 votes). Check out past polls.

    Notices?