Analysis Script and output txt file