My CSV is like:
username, lastname, firstname, age, weight, location
If I don't have a value, I need to have just the comma with no data like:
blankman, man, blank,,,usa
Right now I have:
blankman, man, blank, '','',usa
Because I am doing this like:
users = U开发者_如何转开发ser.....
users.each { |user|
age = ''
csv << [ ... ,age, ... ]
}
If I left the variable age
uninitialized, then I got an error.
not sure what to do?
Try using age = nil
.
精彩评论