#!/bin/bash

data_root="/hildafs/home/yueying/datasets/Asterix/PIG_files"
output_root="/hildafs/home/yueying/datasets/public/ASTRID/compressed_files"

for i in 017 020 023 031 047 107 147 214; do
	data_dir="$data_root/PIG_$i"
	output_dir="$output_root/PIG_$i"

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

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

done
