#!/bin/sh for i in *.final do fname=$(echo $i | sed "s/.final/.d/") awk '{ print $2, $3, $5 }' < $i > $fname done paste it ram_index.d cached_index.d semi_index.d uncached_index.d > ../data/index.d paste it ram_partitions.d cached_partitions.d semi_partitions.d uncached_partitions.d > ../data/partitions.d paste it ram_tags.d cached_tags.d semi_tags.d uncached_tags.d > ../data/tags.d