這個文件是我在運行包含推文的項目時得到的結果,每條推文都有自己的ID和Id,可能會出現多次,可能不是。計算不止一次出現的推文總數
Start: 1458763849881
712044789663924224 RT @WHUFC_News: West Ham are the only team in the top half of the Premier League without a player in the England squad.
712044789663928320 RT @BlackPplVines: Don't say anything just RT
712044789659787266 the 100 is wild []
712044789630275584 RT @SincerelyTumblr: me trying to concentrate []
712044789630283776 RT @Marie_aguilar98: Bless the man that ends up with me because I have a big attitude along with a big temper []
712044789647147009 If you could visit any place in the World, where would it be? — Hawaii and Japan []
712044789659787268 ほんとやめて、視聴者を殺しに來るのは []
712044789647052800 Who wanna be nice enough to bring me some [[712044789663928320,"RT Don't say anything just RT ,0.0]]
712044789634637825 Y6 drama #for #against #debate @MissT_02 @Michelle_Hill[[712044789663928320,"RT Don't say anything just RT ,0.2316541497936268]]
我需要計算出現不止一次的推文總數? 只有一次出現的推文總數?
鳴叫這裏有ID開始7120447896
當鳴叫再次出現將有相同的ID
像它具有ID 712044789663928320,並在最後一行,我寫
我如何開始再次出現主推?正如我開始覺得,使在ID循環,但我不能把它寫以及
FileReader reader =new FileReader("/home/user/results.txt");
Scanner scnr = new Scanner(reader);
HashMap< String, Integer>h=new HashMap<String, Integer>();
int lineNumber = 1;
while(scnr.hasNextLine()){
String line = scnr.nextLine();
h.put(line, i);
lineNumber++;
請訪問[幫助],參加[導覽]並閱讀[問]。 –
謝謝,但我需要知道如何開始正確思考,這是什麼問題? – user5520049
問題是,這不是StackOverflow的工作方式。這不是教程或討論網站。如果你不知道從哪裏開始,還有其他類型的討論網站。 –