in reply to Re: How to speed up/multi thread extract from txt files?
in thread How to speed up/multi thread extract from txt files?
## extract all the param values from the stdf sub get_paramValue { my ($stdf,$lot,$oper,$sum,%param_flag) = @_; my ($output); print "Running with stdf:$stdf.\n"; &log("get_paramValue","Running with stdf:$stdf."); if(-e $stdf){ ## create the output file name, similar to the stdf name but w +ith .log ext $output = $outputdir.$lot."_".$oper."_".$sum.".log"; open(OUT, ">$output") or &log("get_paramValue","Can't write to + output: $output"); print OUT "tname,idx,param_val\n"; open(STDF, $stdf) or &log("get_paramValue","Die can't read fro +m stdf:$stdf."); my (@tmp,$testname,$testFound,$paramVal,$unit_count); while(<STDF>){ 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; } } } ## END while close(STDF); close(OUT); } ## END IF return $output; } ## end sub
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: How to speed up/multi thread extract from txt files?
by weismat (Friar) on Jan 09, 2008 at 17:01 UTC | |
|
Re^3: How to speed up/multi thread extract from txt files? (Updated)
by BrowserUk (Patriarch) on Jan 09, 2008 at 17:47 UTC | |
|
Re^3: How to speed up/multi thread extract from txt files?
by BrowserUk (Patriarch) on Jan 09, 2008 at 23:38 UTC |