Hello, I have set up my spreadsheet in Datavyu to code three dependent measures in one column called help. This way, each cell provides all of the information for one measure. The cells include codes for "event"; which is the type of measure, "yesno", to describe if the participant helped or not; and "how", to describe how the participant acted. I've managed to create a script to export all of the data, and the data appears in time order as expected. However, I would like to structure the file so that all of the data associated with a specific measure occurs in the same group of columns (all of the measures for measure 1 are in the first columns, regardless of the order the participant completes the measures). Is this possible? I've tried to restructure my script using if/else statements, but it returned a blank .csv file. I tried to restructure it again, and I received a "No Methods" error (script below). Do you have any ideas? Thanks! Amanda require 'Datavyu_API.rb' begin out_file = File.expand_path("~/Desktop/SH043015.csv") out = File.new(out_file,'w') filedir = File.expand_path("~/Desktop/SH Coding/") filenames = Dir.new(filedir).entries for file in filenames if file.include?(".opf") and file[0].chr != '.' puts "Please hold..." + filedir+file $db,proj = load_db(filedir+ "/" +file) puts "YAY! Videos loaded correctly :)"
end puts "Done!!!" end end |
Hi Amanda, It sounds like you want to sort help column cells by the event code. This is the easiest way if you can ensure that every file will have one cell for each event code (if not, it's still possible but will require more work in the script). Try doing a regular print, but instead of doing
Let me know if this works/doesn't work or if this is not what you want. |