Created
June 22, 2012 14:47
-
-
Save johnnygoodman/2973191 to your computer and use it in GitHub Desktop.
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
text_in = "12:00:01 AM runq-sz plist-sz ldavg-1 ldavg-5 ldavg-15\n | |
05:20:01 PM 1 346 0.34 0.52 0.60\n | |
05:22:01 PM 21 362 12.05 3.52 1.60\n | |
05:24:02 PM 14 354 12.20 6.84 3.08\n | |
05:26:01 PM 13 365 9.93 7.65 3.83\n | |
05:28:01 PM 21 375 13.20 9.64 5.02\n | |
05:30:03 PM 16 364 16.43 12.16 6.53\n | |
05:32:02 PM 13 353 13.79 12.90 7.47\n | |
05:34:01 PM 28 370 14.36 13.67 8.42\n | |
05:36:01 PM 1 343 4.92 11.11 8.17\n | |
05:38:01 PM 0 327 0.86 7.52 7.21\n | |
Average: 1 337 0.76 0.76 0.73" | |
a = text_in.split("\n") | |
a.each do |line| | |
modded_line = line.split(" ").join("|") unless line == "" | |
puts "|#{modded_line}|" unless line == "" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment