Skip to content

Commit

Permalink
Added a preprocess script.
Browse files Browse the repository at this point in the history
  • Loading branch information
dam7633 committed Mar 20, 2013
1 parent 7681eb9 commit e4d66e2
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions preprocess.rb
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit e4d66e2

Please sign in to comment.