#!/usr/bin/perl

# This program removes trailing spaces from the value in the instrument
# host column in the index.tab included in peer-reviewed version of the
# DI ITS Reduced Encounter (science) data set v2.0.
#
# Inputs:
#
#   index.tab_orig = Original index file. 
#
# Outputs:
#
#   index.tab       = PDS-required index table.
#
#
# To run (from index/):
#
#    >cd /n/diraid02/data/lien/dihv9p_enc_v2/index
#    >../../stef_stuff/extract_required_index_hrii.pl
#
# History:
#
#    2007-07-06  sam  Created.
#
#---------------------------------------------------------------------------

system ("cp -p index.tab index.tab_orig");
system ("cp -p index.lbl index.tab_lbl");

open (INTAB, "<index.tab_orig") || die "Unable to open index/index.tab_orig";
open (OUTTAB,">index.tab")       || die "Unable to open index/index.tab";

while ($line=<INTAB>)
{ $line =~ s/VISIBLE CCD     /VISIBLE CCD/; # reduction level
  print OUTTAB $line;
}

close INTAB;
close OUTTAB;

