提醒:過濾重複的 eamil 帳號 2011年04月09日

来自: Ask Avain Ruby
演示:以MSN订阅提醒为例 订阅到哪吒,有更新提醒我
哪吒机器人提醒:
提醒: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)
收藏 |  评论 |  推荐给好友  | 
本文共有 0 次分享
来自 Ask Avain Ruby 的其他文章
评论
共有 - 条评论


我要反馈