哪吒机器人提醒:

提醒:Ask Avain Ruby
【标题】過濾重複的 eamil 帳號
【摘要】#!/usr/bin/rubyfilename = "webx.txt" # Read the external filedestination = "attendee.unique.txt"file = open(filename) # Create the object "file"dfile = open(destination,"w+")a = []while text = file.gets do # use "gets" to the file line by line a.push(text.chomp + ",\n") # "chomp" is to cut off the \n or \renda.uniq # Returns a new array by removing duplicate values#puts a # print out the arraydfile.write(a)file.close # [...]... (04-09 11:23)