-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
dam7633
committed
Mar 20, 2013
1 parent
7681eb9
commit e4d66e2
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|