#!/bin/bash # Creation of merged file all.csv for stn in *;do echo $stn;prepend first="STN," text="${stn}," $stn > ${stn}.1;done for stn in *.1;do echo $stn;perl -pe 's/[01]_/_/g;s/Epoch/EPOCH/' $stn > ${stn}2 ;done mergeheaders *.12 > all.csv rm *.1 *.12