[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cobalt-users] handling a .raq file
- Subject: Re: [cobalt-users] handling a .raq file
- From: Gerald Young <me@xxxxxxxxxxx>
- Date: Fri Aug 10 23:39:24 2001
- Organization: Coolcat Dot Net ltd
- List-id: Mailing list for users to share thoughts on Cobalt products. <cobalt-users.list.cobalt.com>
> I think it was on sourceforge but I am not sure. Could anybody direct me to
> this link?
hello i cant find it online so here it is works a treat.
b w Wampy
#!/usr/bin/perl
# based on code by Jeff Bilicki <jeffb@xxxxxxxxxxxxx>
# modified by Ben Charlton <bencharlton@xxxxxxxxxxxx>
# support added for RaQ3 .raq backup files.
#
# This code removes the custom header information from the backup file. use strict; my ($infile);
my ($outfile);
my ($end) = "\%\%END_INDEX";
my ($begin) = "\%\%BACKUP_HEADER";
my ($end2) = "\%\%END_XML";
my ($begin2) = "\%\%BACKUP_XML"; if (@ARGV) {
$infile = $ARGV[0];
$outfile = $ARGV[1];
} else {
print "usage: strip.pl <file to clean> <output file>\n\nOutput file should be a .tar.gz\n";
exit 1;
} open (INFILE, $infile) or die "Can't open: $!\n";
open (OUTFILE, ">$outfile") or die "Can't open $!\n"; while (<INFILE>) {
if ( /^$begin/ ... /^$end/ ) {
next;
} else {
if ( /^$begin2/ ... /^$end2/ ) {
next;
} else {
print OUTFILE $_;
}
}
}
close(INFILE);
close(OUTFILE);
exit 0;