perl脚本去除文件中重复数据

perl 2017-07-28

今天第一天写博客,写的不好请大家多多指教,废话不多说了,干货送上:

#############################################################

#!/usr/bin/perl
use warnings;
use strict;
my %hash;
my $source_file=$ARGV[0]; #输入文件
my $dest_file = $ARGV[1];#输出文件
open (FILE,"<$source_file") or die "Cannot open file $!\n"; #打开文件
open (SORTED,">$dest_file") or die "Cannot open file $!\n";
while(defined (my $line = <FILE>))
{#从文件中取出要去重的数据
        chomp($line);#去除空格
     #$line=~ s/[\r\n]+//mg;#取出换行符
        $hash{$line} += 1;
}
foreach my $k (keys %hash) {
        print SORTED "$k\n";#改行打印出列和该列出现的次数到目标文件
}
close (FILE);
close (SORTED);
#############################################################

将这个#号中的内容添加好以后使用chmod +x 文件名加上权限,使用“./data.pl 源文件 目标文件”命令运行即可


本文由 admin 创作,采用 知识共享署名 3.0,可自由转载、引用,但需署名作者且注明文章出处。

2518 条评论

  1. bzcigftr
    bzcigftr

    perl脚本去除文件中重复数据 - 青花瓷
    [url=http://www.g14lb98o6jmiuxy12m084x41l836di6ds.org/]ubzcigftr[/url]
    abzcigftr
    bzcigftr http://www.g14lb98o6jmiuxy12m084x41l836di6ds.org/

    1. Off White Jordan 1
      Off White Jordan 1

      Jordan 12 Gym Red http://www.jordan12gymred.us.com/
      Nike Outlet satore http://www.nikefactoryoutletstoreonline.com/
      Nike Outlet satore http://www.nikefactoryoutletstoreonline.us/
      Nike Outlet satore http://www.nikestores.us.com/
      retro jordan 33 http://www.jordan33.us/
      cheap jerseys http://www.cheapjerseysfromchina.us/
      custom nfl jerseys http://www.customnfljerseys.us/
      jordan 11 concord 2018 http://www.jordan11concord.us.com/
      Jordan 12 Gym Red http://www.jordan12gymred.us/
      Red Jordan 12 http://www.redjordan12.us/
      Yeezys http://www.yeezy.com.co/
      Yeezy Shoes http://www.yeezys.us.com/

    2. Williamimife
      Williamimife

      best buy for cialis
      cialis espn.
      https://drinksomethingreal.com
      generic cialis online pharmacy review
      why is cialis so expensive
      Cheap cialis buy online
      comprare cialis online sicuro
      cialis online bestellen nachnahme
      https://drinksomethingreal.com
      cialis 5mg price canada
      peux t on acheter du cialis en espagne
      CIALIS 100 MG CHEAP

    3. WilliamDor
      WilliamDor

      when is cialis going off patent
      get cialis online
      https://christinehulme.com
      adcirca vs cialis price
      delta enterprises cialis
      CIALIS 100 MG CHEAP
      popular pills online comprar cialis spain
      cialis for sale net
      https://christinehulme.com
      cialis kupovina
      fast shipping cialis
      Cialis 100 mg

    4. Williamimife
      Williamimife

      good place to buy generic cialis
      cialis drug class
      https://christinehulme.com
      cost comparison for cialis
      cumpar cialis online
      Cheap cialis buy online
      vente cialise
      acquistare cialis online con postepay
      https://drinksomethingreal.com
      buy cialis in soho
      bph and cialis
      Cialis 100 mg cheap price

    5. Gerardben
      Gerardben

      mayavanrosendaal.com
      http://www.mayavanrosendaal.com mayavanrosendaal.com cialis without prescription cialis without prescription

    6. ArnoldInfus
      ArnoldInfus

      buy generic cialis tadalafil
      cost for cialis
      Buy Cheap Cialis
      cialis sklep online
      cialis while trying to get pregnant
      Buy Cheap Cialis Online
      cialis spedizione gratuita
      cialis sample packs
      Buy Cheap Cialis Online

    7. DavidMof
      DavidMof

      socialist caucus
      cialis australia next day delivery
      generic cialis at walmart
      best place to buy cialis jelly
      cialisproffesional
      5 mg cialis coupon printable
      cialis efectos
      liquid cialis blue bottle
      http://kaivanrosendaal.com/#interactions-for-cialis

    8. ArnoldInfus
      ArnoldInfus

      cialis purchace on line fast no rx
      ordering cialis from canada
      buy cialis
      cialis preise rezeptfrei
      everyday cialis online
      Buy Cialis Online
      cialis price in rupees
      genuine cialis cost
      Buy Cheap Cialis Online

    9. DavidMof
      DavidMof

      cialis online italia
      drug supplier cialis generic
      interactions for cialis
      cialis online nederland
      costco price for cialis
      cialis manufacturer coupon
      best price online cialis 10mg
      cialis store erfahrungen
      http://kaivanrosendaal.com/#cialis-coupons-printable

    10. ArnoldInfus
      ArnoldInfus

      cheap cialis from mexico
      cialis madrid
      Cheap Cialis
      best website for generic cialis
      online pharmacy for cialis
      Buy Cheap Cialis Online
      cialis prescription cost
      long term use cialis effects
      Buy Cheap Cialis

    11. Gerardben
      Gerardben

      buy cialis without prescription
      cialis without prescription online http://www.mayavanrosendaal.com buy cialis without prescription cialis without prescription online

    12. DavidMof
      DavidMof

      does insurance cover cialis
      gunstiges cialis
      Buy Cheap Cialis
      cialis 20mg preisvergleich
      lady cialis side effects
      Buy Cheap Cialis Online
      cialis super active vs cialis
      vancouver cialis
      http://kaivanrosendaal.com/#viagra-vs-cialis

    13. DavidMof
      DavidMof

      order female cialis free trial
      comprar cialis en farmacia online
      cialis.com
      do you need a prescription for generic cialis
      cialis 5mg best price canada
      what is cialis
      cialis 25mg
      best cialis
      http://kaivanrosendaal.com/#5-mg-cialis-coupon-printable

    14. Gerardben
      Gerardben

      mayavanrosendaal.com
      cialis without prescription online buy cialis without a doctor's prescription mayavanrosendaal.com cialis without a doctor's prescription

    15. DavidMof
      DavidMof

      cialis 10mg prix
      generic cialis fedex
      Buy Cheap Cialis
      www buycialisonlinecheap
      necesito comprar cialis
      cialis 30 day sample
      cialis effet secondaire
      cialis liquid
      http://kaivanrosendaal.com/#discount-cialis

    16. ArnoldInfus
      ArnoldInfus

      100 mg generic cialis
      cialis super active canada
      Buy Cheap Cialis Online
      non de site pour cialis
      acquistare cialis generico con ebay
      Buy Cheap Cialis
      fake cialis
      brand cialis online usa
      Cheap Cialis

    17. DavidMof
      DavidMof

      cialis tadalafil kaufen
      cheaper than cialis
      cialis.com
      cialis at tesco pharmacy
      super facialist vitamin c serum review
      Cialis Cheap Buy Online
      much does cialis cost cvs
      generic cialis online overnight
      http://kaivanrosendaal.com/#how-does-cialis-work

    18. Duanedyday
      Duanedyday

      sample pack of cialis online
      da narucim cialis
      Cheap cialis buy online
      cialis 20g
      monthly cost of daily cialis
      https://kellyannehulme.com
      cheap cialis extra strength
      cialis to buy in south africa
      20 mg cialis
      discount cialis canada
      buy cialis with money order
      https://greatwinesgrandhouses.com

    19. DavidMof
      DavidMof

      was kostet cialis in der apothekecialis pills shanghai cialis cheap
      cialis reimportcialis dosage options Buy cheap cialis

    20. DavidMof
      DavidMof

      Cialis Super Active usafree cialis coupons cialis cheap
      cialis online sicuro opinionidove comprare cialis generico online forum Buy cheap cialis

    21. DavidMof
      DavidMof

      sito sicuro comprare cialiscialis tadalafil 20mg reviews cheap cialis
      rising cost of cialispastillas cialis de canada Buy cheap cialis

    22. Duanedyday
      Duanedyday

      one week supply of cialis
      buy cialis in portugal
      20 mg cialis
      cialis sold on the street
      national socialist movement
      https://greatwinesgrandhouses.com
      cialis money order
      cialis red pill
      cialis buy online
      pharmacy discount card for cialis
      what is the price of cialis at walmart
      https://greatwinesgrandhouses.com

    23. Williamimife
      Williamimife

      cialis in delhi
      is online cialis legitimate
      https://christinehulme.com
      buy cialis generic canada
      best price cialis 20mg
      buy cialis
      cialis without insurance
      cialis strength
      https://drinksomethingreal.com
      cialis instructions
      buy generic cialis from canada
      20 mg cialis buy

    24. DavidMof
      DavidMof

      cialis miglior prezzosuper active cialis cialis cheap
      what does cialis for daily use cost 105buy orginal cialis cheap cialis

    25. DavidMof
      DavidMof

      cialis price amazoncialis pro fastest delivery cheap cialis
      pildora cialisextra meds buy cialis Buy cheap cialis

    26. Duanedyday
      Duanedyday

      rite aid pharmacy cialis cost
      actors in cialis commercials
      20 mg cialis buy
      seguros los genericos de cialis
      cialis cost without insurance
      https://kellyannehulme.com
      blue cross blue shield cialis cost
      best online pharmacy for generic cialis
      Cheap cialis buy
      cialis acquistp
      harm of cialis two pills in 24 hours
      https://greatwinesgrandhouses.com

    27. DavidMof
      DavidMof

      cialis cheapest price canadacialis for daily use cost at walmart cheap cialis
      buy cialis portland oregoncialis and alcohol cheap cialis

    28. Williamimife
      Williamimife

      apotheke cialis
      forum_site_achat_cialis
      https://christinehulme.com
      cialis afhalen
      cialis dosages available
      100 mg cialis
      cheapest cialis 20mg
      order cialis over night
      https://christinehulme.com
      brand name cialis discount online no rx
      a secure site to buy cialis on ebay
      buy cialis

    29. Gerardben
      Gerardben

      trusted tabled cialis softabs
      medicine cialis tablets
      buy cialis without prescription
      generic cialis free sample
      cialis or vardenafil 20mg tablet
      cialis without prescription
      cialis without prescription forum
      cialis singapore pharmacy
      cialis without a doctor's prescription
      buy cialis auckland
      best buy cialis
      cialis without a doctor's prescription

    30. Gerardben
      Gerardben

      best website to buy cialis
      discount cialis with prescription
      cialis without a doctor's prescription
      cialisonline4all online pharmacy review
      cialis chewable reviews
      buy cialis without a doctor's prescription
      cialis online overnight shipping
      cialis dosage instructions
      cialis without prescription
      cialis generika ohne kreditkarte
      buy cialis in arizona
      mayavanrosendaal.com

    31. Gerardben
      Gerardben

      order cheap cialis
      super cialis 100mg
      cialis without a doctor's prescription
      cialis generika online kaufen osterreich
      cialis cost chemist warehouse
      buy cialis without a doctor's prescription
      cialis oder kamagra
      cheap cialis super activelink.com
      cialis without prescription
      cialis pricing walgreens
      cialis pill brand 5mg
      buy cialis without prescription

    32. RalphSpamb
      RalphSpamb

      buy real viagraviagra patent expiration date Viagra 100 Mg
      viagra generic online canadaviagra contrareembolsoViagra 100Mg

    33. AnthonyElals
      AnthonyElals

      forum_site_achat_cialiswas ist cialis skylensnw.com
      rite aid pharmacy cialis costcialis international shipping http://westerndeliveryandlogistics.com
      comprar cialis online en mexicocialis daily vs 36 hour http://westerndeliveryandlogistics.com/#cialis-20m
      cialis kaufen ohne kreditkartewhy would cialis stop working californiadeliveryandlogistics.com
      cialis rush ordercialis price checker skylens.us
      generic cialis canada customswhat is cialis 20mg used for http://skylens.us/#cialis

    34. RalphSpamb
      RalphSpamb

      viagra zonder voorschriftgeneric viagra without rx buy viagra 100mg
      which is better viagra or levitraerfahrungsbericht viagrageneric viagra 100 mg
      http://stemchat.com

    35. AnthonyElals
      AnthonyElals

      what is the cost of cialis 5mgwalgreens pharmacy prices cialis http://westerndeliveryandlogistics.com
      cialis patenttigeneric cialis 10mg reviews http://westerndeliveryandlogistics.com
      cialis online schweizcheapest way to buy cialis http://westerndeliveryandlogistics.com/#cialis
      buy cialis manchestercialis drugs online skylens.us
      cialis for sale dublincialis generic best price and delivery http://skylensnw.com/cialis
      cialis naturalbuy cialis online france п»їhttp://skylensnw.com/#cialis

    36. HermanEdunc
      HermanEdunc

      cialis online without subscribtiondoes cialis make you horny skylens.us
      buy cialis cypruscialis 30 tadalafil 30mg ml skylensnw.com
      cheapest cialis genericcialis 100 mg prezzo http://westerndeliveryandlogistics.com/#buy
      cialis100mgorder cialis without prescription http://californiadeliveryandlogistics.com/#cialis
      buy cialis online using echeckachat cialis 5mg westerndeliveryservice.com
      cialis black 800 mg reviewslloyds pharmacy cialis 10mg http://westerndeliveryandlogistics.com/#buy-cialis

    37. AnthonyElals
      AnthonyElals

      cialis internet purchasesecure sites to buy cialis http://westerndeliveryservice.com/#cialis
      insurance cialis daily bhpvente cialis france http://westerndeliveryandlogistics.com/#cialis
      jual cialis onlinecialis generic name http://westerndeliveryandlogistics.com/#buy-cialis
      cialis in sam cluborder real cialis http://skylensnw.com/cialis
      cialis rezeptfrei aus deutschlandcialis same day shipping http://westerndeliveryservice.com
      cialis discount couponcialis toronto п»їhttp://skylensnw.com/#cialis

    38. RalphSpamb
      RalphSpamb

      sustitutos viagranombres de viagras Viagra 100Mg
      viagra calgaryviagra street priceViagra 100Mg
      http://stemchat.com

    39. AnthonyElals
      AnthonyElals

      sams club pharmacy cialiscialis private prescription charges skylens.us
      cialis controindicazionicialis five day delivery usps skylensnw.com
      buy generic cialis europe40mg dose of cialis http://californiadeliveryandlogistics.com/#buy
      cost of cialis in uaecialis 4cpr riv 10 mg costo http://skylens.us/
      cialis online in 3 dayscialis otc http://californiadeliveryandlogistics.com/#cialis
      cialis picturecialis tablete cena http://skylens.us/#cheap

    40. AnthonyElals
      AnthonyElals

      what dosage of cialis should i takecheap cialis extra strength californiadeliveryandlogistics.com
      buy cialis online no prescription canadacostco pharmacy cialis cost http://westerndeliveryandlogistics.com
      cialis to buy mail orderbuy cheap cialis site http://skylens.us/#buy-cialis
      buy generic cialis online europecialis pills sale ontario westerndeliveryservice.com
      veilig online cialis kopencialis cheapest price canada westerndeliveryandlogistics.com
      recensioni acquisto cialis onlinecialis super aktiv http://californiadeliveryandlogistics.com/#cialis

    41. Gerardben
      Gerardben

      comprime cialis cialis without doctor's prescription
      http://www.mayavanrosendaal.com

    42. Henryfrino
      Henryfrino

      5mg daliy cialis reviews cialis 40mg
      https://skylensnw.com

    43. Henryfrino
      Henryfrino

      cheap cialis super active ride cialis 60mg
      https://skylensnw.com

    44. Henryfrino
      Henryfrino

      cialis in frankreich https://skylensnw.com
      https://skylensnw.com

      http://shorl.com/stelitapubutra
      https://yogaasanas.science/wiki/Originalcialis20mgprice
      http://help.expresstracking.org/index.php?qa=user&qa_1=filtenborgeliasen8

    45. Henryfrino
      Henryfrino

      cialis online kaufen deutschland cialis 20mg
      https://skylensnw.com

      http://whanswerz.com/index.php?qa=user&qa_1=jacobsonphilipsen0
      http://tinyurl.com/wlnonr25
      https://zzb.bz/YDHoL

    46. TerenceGlulp
      TerenceGlulp

      discount vouchers for cialis buy cialis
      https://kellyannehulme.com

      http://www.2tontos.com/index.php?qa=user&qa_1=kristoffersencates4
      http://www.2019guomo.com/home.php?mod=space&uid=956729
      http://www.ahipoker.com/index.php?qa=user&qa_1=gilliamsandoval4

    47. Henryfrino
      Henryfrino

      search cialis skylensnw.com
      https://skylensnw.com

      https://photoshopcreative.co.uk/user/eliasenmcclure1
      https://www.powerwagonhq.com/author/philipsenboesen5/
      https://christoffersenphilipsen0damlohmann695.shutterfly.com/21

    48. TerenceGlulp
      TerenceGlulp

      cheapest cialis usa Cheap cialis buy online
      https://kellyannehulme.com

      http://www.uzaktanegitimrehberi.com/forum/uye-kristoffersenmcclure4.html
      http://www.ccchinese.ca/home.php?mod=space&uid=1900447
      http://land.site.ge/user/IbrahimIbrahim6/

    49. Henryfrino
      Henryfrino

      cialis no presciptiononline cialis 20mg
      https://skylensnw.com

      https://buyandsellhair.com/author/bjerregaardmcclure3/
      https://photoshopcreative.co.uk/user/eliasenmcclure1
      http://thesocialbuster.com/story.php?title=effetscialis20mg#discuss

    50. TerenceGlulp
      TerenceGlulp

      does cialis daily work cialis cheap
      https://kellyannehulme.com

      http://2.gp/MTQ6
      https://tiny.cc/r0tb3y
      http://chezmick.free.fr/index.php?task=profile&id=284751

    51. Henryfrino
      Henryfrino

      does cialis lower blood pressure skylensnw.com
      https://skylensnw.com

      http://leoclassifieds.com/author/guptafiltenborg2/
      http://sw.dtri.com/qtoa/index.php?qa=user&qa_1=catesibrahim1
      https://menwiki.men/wiki/Efectossecundarioscialis20mgtab

    52. Henryfrino
      Henryfrino

      cialis with depoxetine Buy cialis 20mg
      https://skylensnw.com

      http://shorl.com/ratahafujury
      https://nirvana.virtus.ufcg.edu.br/wiki/isensor/index.php/Usu%C3%A1rio:Lentzbjerregaard2
      http://otokurulum.axoyun.net/forum/member.php?action=profile&uid=253708

      http://0rz.tw/create?url=http%3A%2F%2Fskylensnw.com
      http://www.magcloud.com/user/skipper36lorentsen
      https://photoshopcreative.co.uk/user/risager88skipper

    53. TerenceGlulp
      TerenceGlulp

      cialis insurance online cheap

      https://wanelo.co/oliveroliver53
      http://114.71.1.161/index.php?title=Cialis_Without_Doctor_Prescription_Online
      http://adfoc.us/x71422600

    54. TerenceGlulp
      TerenceGlulp

      fastest super cialis delivery cialis cheap

      http://chezmick.free.fr/index.php?task=profile&id=286144
      http://steffensentruelsen31.ebook-123.com/post/all-products-in-cialis-class
      http://chilp.it/2b88c88

    55. Henryfrino
      Henryfrino

      order cialis online with paypal Buy cialis 60 mg
      https://skylensnw.com

      https://buzzon.khaleejtimes.com/author/bjerregaardmcclure6/
      https://kristoffersenlentz1.picturepush.com/profile
      http://ity.im/2lFiv

      https://openload.co/f/aMaR6USIA8M/Reviews_Ratings_Comments_By_Sufferers_Cialis_Proffesional_Is_Considered_To_Be_Primarily_The_Most_Protectedsessu.pdf
      https://foursquare.com/user/526823476/list/buy-low-cost-cialis-online
      http://www.24x7buddy.com/index.php?qa=user&qa_1=lorentsen11pena

    56. Gerardben
      Gerardben

      much does cialis cost cvs http://www.mayavanrosendaal.com

      https://acrelinux.stream/wiki/Opinions_Ratings_Feedback_By_Sufferers_Cialis_Proffesional_Is_Thoughtabout_To_Be_Essentially_The_Most_Safe
      https://humanlove.stream/wiki/Order_Cialis_Online_NOW
      https://goldstein93krog.picturepush.com/profile
      http://hamannwhittaker2.xtgem.com/__xt_blog/__xtblog_entry/13384942-purchase-canadian-pharmacy-cialis-online#xt_blog
      http://ge.tt/4XQ1Xeu2/v/0

      cialis coupon voucher cialis without a doctor's prescription

    57. BrianEcope
      BrianEcope

      free dating sites toronto ontario blind dating watch online dating cocoa beach fl
      adult dating mia gurnee il how to check dating sites using email address online dating in orlando fl
      adult dating site with free messaging Cougar Com Dating online dating sites without credit card payments
      how many people act differently in person after online dating male ironton ohio 45 dating dating services san diego ca
      san diego best online dating sites asian singles dating chicago is spark adult hookup dating app reviews
      what indicates quality with free dating sites native american dating sites why do w