Created
July 26, 2019 19:00
-
-
Save mbklein/7aca6e1d7839c84e49d4347fe321f440 to your computer and use it in GitHub Desktop.
Generate large spreadsheet
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
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