-
-
Save mickey24/537536 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
#/usr/bin/env ruby | |
def open_t_delimited_file(filename) | |
h = {} | |
open(filename) {|f| | |
f.each_line do |line| | |
a = line.split("\t") | |
h[a[0]] = a | |
end | |
} | |
puts filename + " was loaded." | |
h | |
end | |
if __FILE__ == $PROGRAM_NAME | |
b = open_t_delimited_file(ARGV[0]) | |
open("b_hash.dump","wb") {|f| | |
Marshal.dump(b,f) | |
} | |
end |
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 | |
open("b_hash.dump","rb") {|f| | |
str = Marshal.load(f) | |
puts str["NM_001081381"] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment