Gossamer Forum
Home : Products : Links 2.0 : Discussions :

Re: [Bmxer] how to reorganise links.db

Quote Reply
Re: [Bmxer] how to reorganise links.db In reply to
Shall I save you the trouble :)

Code:
my $i;
my @line;

open F, "</path/to/links.db" or die $!;
open O, ">/path/to/links.db.new" or die $!;
while (<F>) {
$i++;
chomp;
@line = split /\|/;
shift @line;
print O "$i|" . join("|", @line) . "\n";
}
close O;
close F;

open L, ">/path/to/linkid.txt" or die $!;
print L $i;
close L;

..that isn't tested but has a 75% chance of working Angelic



Last edited by:

PaulW: Nov 24, 2001, 9:21 AM
Subject Author Views Date
Thread how to reorganise links.db chris2002 7520 Nov 23, 2001, 11:41 PM
Thread Re: [chris2002] how to reorganise links.db
Andy 7414 Nov 24, 2001, 7:07 AM
Thread Re: [AndyNewby] how to reorganise links.db
chris2002 7430 Nov 24, 2001, 7:54 AM
Thread Re: [chris2002] how to reorganise links.db
Paul 7415 Nov 24, 2001, 8:25 AM
Thread Re: [PaulW] how to reorganise links.db
chris2002 7399 Nov 24, 2001, 8:26 AM
Post Re: [chris2002] how to reorganise links.db
Paul 7384 Nov 24, 2001, 8:34 AM
Thread Re: [chris2002] how to reorganise links.db
Bmxer 7427 Nov 24, 2001, 9:09 AM
Thread Re: [Bmxer] how to reorganise links.db
Paul 7398 Nov 24, 2001, 9:17 AM
Thread Re: [PaulW] how to reorganise links.db
Bmxer 7407 Nov 24, 2001, 9:53 AM
Thread Re: [Bmxer] how to reorganise links.db
Paul 7353 Nov 24, 2001, 10:29 AM
Thread Re: [PaulW] how to reorganise links.db
Bmxer 7365 Nov 24, 2001, 12:18 PM
Post Re: [Bmxer] how to reorganise links.db
Paul 7304 Nov 24, 2001, 12:30 PM
Thread Re: [PaulW] how to reorganise links.db
sponge 7340 Nov 24, 2001, 11:59 PM
Post Re: [ThatPerson1024] how to reorganise links.db
Paul 7360 Nov 25, 2001, 3:32 AM
Post Re: [Bmxer] how to reorganise links.db
Stealth 7400 Nov 24, 2001, 5:54 PM