#! /usr1/local/bin/perl -w

print "What is the download script file name?\n";
$filename = <STDIN>;
substr($filename,-1,1) = "";

open(POINT,"$filename");

print "What do you want to name the SCW list file?\n";
$output = <STDIN>;
substr($output,-1,1) = "";

open(POINT2,">$output");

$foo = "swg.fits[1]";

while ($text = <POINT>)
	{
        $test = substr($text,0,4);
        if ($test eq "wget")
           {
           $test2 = substr($text,-27,3);
           if($test2 eq "scw")
              {
              $scw = substr($text,-27,26);
              push(@foo,"$scw");
              }
           }
        }
close(POINT);
@foo2 = sort(@foo);

foreach $foo3 (@foo2)
	{
	print POINT2 "$foo3$foo\n";
        }
close(POINT2);

