Hi Theodore (Pringle) and all!
Happy holidays.
I noticed when dealing with Imp3.txt in this repo -
https://bitbucket.org/shlomif/freecell-pro-3fc-deals - that adding a single
deal index to the middle of the file, and committing resulted in git consuming
90% of my RAM and taking a very long time and later pushing many 10s of
megabytes of changes. I hate to be a slave of our tools but since I doubt we
can find a VCS that can handle this better, I decided to split Imp3.txt into
ranges here:
https://github.com/shlomif/freecell-pro-3fc-deals--split
Here is the script I used which is kinda slow but gets the job done. I'd also
like to write a test suite for the integrity of the data. Is that acceptable to
you?
Regards,
Shlomi Fish
#!/usr/bin/perl
use strict;
use warnings;
use Path::Tiny qw/ path /;
open my $in, '<', 'freecell-pro-3fc-deals/Imp3.txt';
my $old_fn;
my $fh;
while (my $l = <$in>)
{
my $z = sprintf("%010d", int $l);
my $fn = "freecell-pro-3fc-deals--split/Imp3/" . substr($z, 0, 3) . "XXXXXXX.txt";
if ($fn ne $old_fn)
{
$old_fn = $fn;
$fh = path($fn);
}
$fh->append($l);
}
--
-----------------------------------------------------------------
Shlomi Fish http://www.shlomifish.org/
Chuck Norris/etc. Facts - http://www.shlomifish.org/humour/bits/facts/
JATFM == “Just answer the fabulous man”
Please reply to list if it's a mailing list post - http://shlom.in/reply .
Received on Tue Dec 26 2017 - 13:55:49 IST