Skip to content

Instantly share code, notes, and snippets.

@sms420
Created January 6, 2010 23:54
Show Gist options
  • Select an option

  • Save sms420/270823 to your computer and use it in GitHub Desktop.

Select an option

Save sms420/270823 to your computer and use it in GitHub Desktop.
sms load file
#!/usr/local/bin/ruby1.9 -w
#smsloadfile.rb
#2010-01-06
#builds Concordance load file
inFile = File.new('input.txt')
k = 0
a = Array.new
while(str = inFile.gets)
a[k] = str
k += 1
end
outFile = File.new('output.txt','w')
a.each do |i|
outFile.puts ',Y,,,' + i
i = i.to_i
2.upto(i) do |j|
outFile.puts ',,,,'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment