I am writing a script that analyzes the hashtags from tweets that I saved in a text file. So far I managed to count the amount of hashtags in the file:
fid = fopen('Tweets.txt');numberOfTweets = 0;while i ~= -1 i = fgetl(fid); numberOfTweets = numberOfTweets + 1;endnumberOfTweets = numberOfTweets - 1;frewind(fid)for i = 1:numberOfTweets twitterStuff{i} = fgetl(fid);endnumberOfHash = 0;for i = 1:numberOfTweets if(strfind(twitterStuff{i}, '#') ~=0); c = strfind(twitterStuff{i}, '#'); [rowHash columnHash] = size(c); numberOfHash = numberOfHash + columnHash; endend
Now, I want to find out what the specific hashtags are and save them into a cell array, but I don't really know how to do that.
Best Answer