You can use CSV
for parsing files with separators, e.g.:
require 'csv'
CSV.foreach('your_file.txt', col_sep: " ", headers: true).map do |row|
row.to_h
end
#=> [{"purchaser"=>"Jo?o", "name"=>"St", "item"=>"R$20", "description"=>"off" ...},
# {"purchaser"=>"Amy", "name"=>"Rd", "item"=>"awesome", "description"=>"of", ..}, ...]
It seems like this data is ready to process. A more common way is using comma-separated value for files like this, so I would suggest you change file format if you can.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…