Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Moriarty's scratchpad

by Moriarty (Abbot)
on Jun 05, 2004 at 11:48 UTC ( #361492=scratchpad: print w/replies, xml ) Need Help??

Latest Problem

#!/usr/bin/perl -w use strict; if($#ARGV < 2) { die "usage = $0 <input file> <output file> <extracts +file>\n"; } my $INPUT; my $OUTPUT; my $EXTRACTS; my $Extracted = 0; my $extract_list = {}; my $Extract_Cnt; my $numCP = 0; open EXTRACTS, "< $ARGV[2]" or die "Can't open $ARGV[2]\n"; while (<EXTRACTS>) { chomp; $extract_list->{$_}++; } close EXTRACTS; # chomp(@extract_list); $Extract_Cnt = scalar(keys %$extract_list); print "$Extract_Cnt extracts loaded\n"; open INPUT, "< $ARGV[0]" or die "Can't open $ARGV[0] for reading\n"; open OUTPUT, "> $ARGV[1]" or die "Can't open $ARGV[1] for writing\n"; while (<INPUT>) { if (substr($_, 0, 4) eq "<CP>") { $numCP++; if ($numCP % 100 == 0) { printf ("%d\r", $numCP); } my $CheckPoint = $_; my $TFN = substr($CheckPoint, 36, 9); while (substr($TFN, 0, 1) == '0') { $TFN =~ s/^0//; } if (exists $extract_list{$TFN}) { $CheckPoint =~ s/[0-9][0-9]0([YN][YN][YN][YN][YN][YN])/910$1/; $Extracted++; print $CheckPoint; } print OUTPUT $CheckPoint; } else { print OUTPUT $_; } } close INPUT; close OUTPUT; print "$Extracted documents extracted\n";
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
[Corion]: marto: Ow, I hope that gets better soonish! But I feel some $work-timecrunch looming at my $work as well
[Corion]: marto: Ah, so you can multiplex work and PM time ;-D
[Corion]: The upside to this is that I've reduced my $work (well, $paid) time to 80%, so I'll be at $work only four days/week, which will hopefully make the crunch less crunchy on me ;)
[marto]: yeah, so that stays as before. But before the boys were born I'd be on quite often at night (GMT) also
[marto]: I had the option during our TUPE transfer to buy 5 more days holiday. They were shocked when I did :P

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2017-06-29 08:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (655 votes). Check out past polls.