Hello, 2 questions on the same script
Parsing a file and trying to replace all instances of a certain combination with another combination. Prob is it seems to take a rather long time to do this. Anybody think of a quicker way to go about this, rather new to perl programming or is it it just due to the size of the files I am dealing with. Other prob is on the loop .... $6 ALWAYS matches (it should) and $tad ALWAYS equals the last $2 value in the EXT file (eg last line in that file). This shouldn't be happening. $tad should equal the value of the key $6 matched Script below. Thanks in advance, -Peter open (FOUT, '> c:/test.txt'); open (EXT, 'c:/ext'); # Replacement file, Nearly 3000 lines long open (FILE, 'c:/pbx'); # Input file, nearly 20,000 lines long while (<EXT>){ #Write extensions to a hash %ext WHERE /(\d+)=(.*)/; # $value, $equiv_value $ext{$1}=$2; } while (<FILE>) { /(\d{6} \d{4}) (\d{4}) (\w) ([\d ]{6}) ([\d ]{18}) ([\d ]{6}).*/; foreach $key ( keys %ext ) { # if (exists $ext{$6}){ # This is the time consumer $tad=$ext{$key}; # } } if ($3==7 || $3==9){ print FOUT "$1 $2 $3 $4 $5 $tad\n"; } } ################################## Peter Thoenen - Systems Programmer Commercial Communications Camp Bondsteel, Kosovo ################################## begin 600 winmail.dat M>)\^(C<3`0:0"``$```````!``$``0>0!@`(````Y`0```````#H``$)@`$` M(0```#0S,4-!0S)%13`S1#=!-#1"13(Q0SDS,#$T-S!#0T$Y`#<'`06``P`. M````T@<(`!$`%@`J`"D`!@!A`0$@@`,`#@```-('"``1`!4`'@`S``8`7@$! M#8`$``(````"``(``0.0!@"X"P``,@````,``(`((`8``````,````````!& M`````%*%```G:@$`'P`!@`@@!@``````P````````$8`````5(4```$````( M````.0`N`#`````+``N`""`&``````#`````````1@`````&A0````````,` M`H`((`8``````,````````!&``````&%````````"P`#@`@@!@``````P``` M`````$8``````X4````````+``2`""`&``````#`````````1@`````.A0`` M``````,`!8`((`8``````,````````!&`````!"%`````````P`&@`@@!@`` M````P````````$8`````$84````````#``>`""`&``````#`````````1@`` M```8A0```````!\`"(`((`8``````,````````!&`````#:%```!`````@`` M```````?``F`""`&``````#`````````1@`````WA0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`[PCP[83X\*5P```&1`S!45R-7_P40 M#K`Y4`[0"?``D!Z2(E$G(3`3X#?@("4.PE=(&$5211U4)P`O*%P!`/`K*3TH M+BHIOB\9,%1=-G`ZDRV@)#EA^&EV7SJ35Y9:@`[05"#R)`!0?3TZ8$G57$!2 MGW]3H4\25``#,```5ZI4(#;W7$`#,%^B-%Q`.$!?A&!VRG=@H5M8,2!=7\-A MN?PQ.&)[8F)8H%C15Z4"$-<8(`#0):`D0>(H0=($(']6\UZS5%U7EB<`!I`[ MX7C]!`!T!"!;Q6)B9N]9E3W3WR=Q'P(IDP6@`(!U!X!'1?]H8C^47&!;U$'A M7$!8[F>N!UT&<,IHHB0S/3TWV2<`?'PV<')Q.6GR:!?/+O`+@`5`2'(@(EP@ M.E)K<F`V<#0V<#4XDU@P;NXB9*==!UT;(WA/>5X@5=M'$CW!;PGP2#$M%%$> M8+\G\B<A+R-'-@A0?*)C!S&K$B$O4'4#`&,E$W-\Y>L?4#800@(@9'OA'0`M MH,!+;W-O=F]W[X&?!7H*?8.`'P!P``$```!>````3@!E`'<`8@!I`&4`.@`@ M`$8`80!S`'0`90!R`"``=P!A`'D`(`!T`&\`(`!D`&\`(`!T`&@`:0!S`"`` M80!N`&0`(`!H`&$`<P!H`"``<`!R`&\`8@!L`&4`;0```````@%Q``$````6 M`````<)&+J>T:@66*V\_0SN7A_PF9(BL3@``"P`"``$````#``E9`0````,` MWC_I_0``0``Y``#W>:$N1L(!`P#Q/PD$```?`#%``0```!````!4`$@`10!/ M`$X`10!0`````P`:0``````?`#!``0```!````!4`$@`10!/`$X`10!0```` M`P`90``````#`/T_Y`0```,`)@```````P`V```````#`(`0_____P(!1P`! M````.0```&,]55,[83T@.W`]3U)'04Y)6D%424]..VP]0D].1%-4145,,BTP M,C`X,3<R,#0R-#%:+34T-#4W``````(!^3\!````5@````````#<IT#(P$(0 M&K2Y"``K+^&"`0`````````O3SU/4D=!3DE:051)3TXO3U4]5$9&($)/3D13 M5$5%3"]#3CU214-)4$E%3E13+T-./51(14].15`````?`/@_`0```#````!0 M`&4`=`!E`'(`(`!4`&@`;P!E`&X`90!N`"``(`!-`'(`+@`@`"``10!0`%,` M```?`#A``0```!````!4`$@`10!/`$X`10!0`````@'[/P$```!6```````` M`-RG0,C`0A`:M+D(`"LOX8(!`````````"]//4]21T%.25I!5$E/3B]/53U4 M1D8@0D].1%-4145,+T-./5)%0TE0245.5%,O0TX]5$A%3TY%4````!\`^C\! M````,````%``90!T`&4`<@`@`%0`:`!O`&4`;@!E`&X`(``@`$T`<@`N`"`` M(`!%`%``4P```!\`.4`!````$````%0`2`!%`$\`3@!%`%````!```<PU+9W MH2Y&P@%```@PSMG"F"1&P@$?`!H``0```!(```!)`%``30`N`$X`3P!4`$4` M`````!\`-P`!````7@```$X`90!W`&(`:0!E`#H`(`!&`&$`<P!T`&4`<@`@ M`'<`80!Y`"``=`!O`"``9`!O`"``=`!H`&D`<P`@`&$`;@!D`"``:`!A`',` M:``@`'``<@!O`&(`;`!E`&T``````!\`/0`!`````@`````````?`!T.`0`` M`%X```!.`&4`=P!B`&D`90`Z`"``1@!A`',`=`!E`'(`(`!W`&$`>0`@`'0` M;P`@`&0`;P`@`'0`:`!I`',`(`!A`&X`9``@`&@`80!S`&@`(`!P`'(`;P!B M`&P`90!M```````?`#40`0```(H````\`$$`-P`S`#,`1@!&`#D`0@`Q`$8` M0@`P`$8`-``T`#$`0@`S`$$`-@`R`#``.0!&`$8`-P`Q`#``,P`P`$4`-0`P M`#$`,``V`#4`.``W`#$`0`!B`&\`;@!D`',`=`!E`&4`;``R`"X`80!R`&4` M=0!R`"X`80!R`&T`>0`N`&T`:0!L`#X```````L`*0``````"P`C```````# M``80J,S'#0,`!Q#;`P```P`0$``````#`!$0`````!X`"!`!````90```$A% M3$Q/+#)154535$E/3E-/3E1(15-!34530U))4%1005)324Y'049)3$5!3D14 M4EE)3D=43U)%4$Q!0T5!3$Q)3E-404Y#15-/1D%#15)404E.0T]-0DE.051) M3TY7251(04X``````@%_``$```!%````/$$W,S-&1CE",49",$8T-#%",T$V M,C`Y1D8W,3`S,$4U,#$P-C4X-S%`8F]N9'-T965L,BYA<F5U<BYA<FUY+FUI (;#X`````)9`= ` end _______________________________________________ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs