我有一個非常大的推文數據庫。大多數推文都有多個#hashtags和@mentions。我希望所有#hashtag都用一列中的空格和另一列中的所有@mentions分隔開。我已經知道如何提取第一個出現的#hashtag
和@mention
。但我不知道要把它們全部拿出來?有些推文有8個#標籤。手動瀏覽推文並複製/粘貼#hashtags和@版本似乎是超過5000條推文的不可或缺的任務。將A列中的所有@mentions和#hashtags複製到Excel中的B列和C列中
這是我想要的一個例子。我有一個欄,我想這將填充列B和C.(我在Windows &時,Excel 2010)
Column A
-----------
Dear #DavidStern, @spurs put a quality team on the floor and should have beat the @heat. Leave #Pop alone. #Spurs a classy organization.
Live broadcast from @Nacho_xtreme: "Papelucho Radio"http://mixlr.com nachoxtreme-radio … #mixlr #pop #dance
"Since You Left" by @EmilNow now playing on KGUP 106.5FM. Listen now on http://www.kgup1065.com #Pop #Rock
Family Night #battleofthegenerations Dad has the #Monkeys Mom has #DonnieOsman @michaelbuble for me #Dubstep for the boys#Pop for sissy
@McKinzeepowell @m0ore21 I love that the PNW and the Midwest are on the same page!! #Pop
我想列B宏是這樣的:
Column B
--------
#DavidStern #Pop #Spurs
#mixlr #pop #dance
#Pop #Rock
#battleofthegenerations #Monkeys #DonnieOsman #Dubstep #Pop
#pop
而C列看起來像這樣:
Column C:
----------
@spurs @heat
@Nacho_xtreme
@EmilNow
@michaelbuble
@McKinzeepowell @m0ore21
你付多少錢:)?說真的,如果你能描述你所嘗試的和你的編程技能水平,那麼這將有所幫助:創建宏,使用VBA,使用Excel對象模型和正則表達式。從常見問題解答:**您的問題應合理範圍。如果你可以想象整本書能夠回答你的問題,那麼你的要求太高了。另請參閱[這裏](http://stackoverflow.com/questions/how-to-ask)。 –