From e4d66e27c3d6739580e8d4a445b9b570db7db040 Mon Sep 17 00:00:00 2001 From: dam7633 Date: Wed, 20 Mar 2013 17:14:24 -0400 Subject: [PATCH] Added a preprocess script. --- preprocess.rb | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 preprocess.rb diff --git a/preprocess.rb b/preprocess.rb new file mode 100755 index 0000000..5694ea1 --- /dev/null +++ b/preprocess.rb @@ -0,0 +1,24 @@ +#!/usr/bin/ruby -w + +=begin +Scheduling Algorithms Trace Event Preprocessor + +Description: Takes a CSV file with two columns + (event time and event type), formatted with the + QNX Momentics Trace Event profiler. + +Usage: + ./preprocess test_in + +=end + +require 'csv' + +CSV.open(ARGV[0] + "-out", 'w') do |csv_out| + CSV.foreach(ARGV[0], 'r') do |row| + row[0].gsub!(/[mus\s]/, '') + row[1].gsub!(/[\D]/, '') + csv_out << row + end +end +