#!/bin/bash

data_root="/hildafs/datasets/Asterix/PIG2"
output_root="/hildafs/datasets/public/ASTRID/compressed_files"

#for i in 013; do
for i in 261 280 311; do
	data_dir="$data_root/PIG_${i}_subfind"
	output_dir="$output_root/PIG_${i}_subfind"

	cd $data_dir/4
	for column in $(ls -d */ | cut -f1 -d'/'); do
		mv "$output_dir/4/$column.tar" "$output_dir/PIG_${i}_4_${column}.tar"
	done	

	cd $data_dir/5
        for column in $(ls -d */ | cut -f1 -d'/'); do
                mv "$output_dir/5/$column.tar" "$output_dir/PIG_${i}_5_${column}.tar"
        done

	cd $data_dir/FOFGroups
	for column in $(ls -d */ | cut -f1 -d'/'); do
                mv "$output_dir/FOFGroups/$column.tar" "$output_dir/PIG_${i}_FOFGroups_${column}.tar"
        done
    cd $data_dir/SubGroups                                                              
    for column in $(ls -d */ | cut -f1 -d'/'); do
                mv "$output_dir/SubGroups/$column.tar" "$output_dir/PIG_${i}_SubGroups_${column}.tar"
        done 
done
