Skip to content

Instantly share code, notes, and snippets.

@mbklein
Created July 26, 2019 19:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mbklein/7aca6e1d7839c84e49d4347fe321f440 to your computer and use it in GitHub Desktop.
Save mbklein/7aca6e1d7839c84e49d4347fe321f440 to your computer and use it in GitHub Desktop.
Generate large spreadsheet
require 'csv'
CSV.open('big_inventory_sheet.csv', 'w') do |csv|
csv << %w(work_accession_number accession_number filename description)
(1..50).each do |work|
(1..100).each do |file|
filename = (0..9).to_a.sample == 0 ? 'missing.tif' : 'present.tif'
csv << ["Test_%3.3d" % work, "Test_%3.3d_%4.4d" % [work, file], filename, "File %d for Work %d" % [file, work]]
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment