in reply to Re^2: How to speed up/multi thread extract from txt files?
in thread How to speed up/multi thread extract from txt files?
That's the trouble with running code in your head. You don't always notice scoping issues. And answer to the question at the end would still help though.
Did you tidy your code up for posting? I ask because there is a logic error in what you've posted that (I think) means that it cannot do what you are wanting it to do.
if(/3_prtnm_/){ @tmp = split(/3_prtnm_/); $unit_count = &trim($tmp[1]); } elsif(/2_tname_/){ @tmp = split(/2_tname_/); $testname = &trim($tmp[1]); if(exists $param_flag{$testname}){ $testFound = 1; } } elsif($testFound){ if(/2_mrslt_/){ @tmp = split(/2_mrslt_/); $paramVal = &trim($tmp[1]); print OUT "$testname,$unit_count,$paramVal\n"; $testFound = 0; } }
Also, how many keys are there in %param_flag and what do they look like?
If you can clarify those, I'll try and adapt the logic of your subroutine to use the big string technique I mentioned above.
|
|---|