Created
October 5, 2011 08:53
-
-
Save labocho/1263962 to your computer and use it in GitHub Desktop.
Convert TSV to WikiTable (TextMate Bundle Command)
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
#!/usr/bin/env ruby | |
# Convert TSV to WikiTable (TextMate Bundle Command) | |
# | |
# Input: Selected Text or Line | |
# Output: Replace Selected Text | |
s = STDIN.readlines.map{|line| line.gsub(/\t/, " || ").gsub(/^/, "| ").strip }.join("\n|-\n") | |
puts "{|class=\"wikitable\"\n#{s}\n|}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment