changes folder structure of in- and output files
This commit is contained in:
@@ -69,8 +69,11 @@ wd = "/home/michael/Documents/PS/Data/collectTweets/"
|
||||
# WD Server
|
||||
# wd = '/home/yunohost.multimedia/polsoc/Politics & Society/TweetCollection/'
|
||||
|
||||
# datafile input directory
|
||||
di = "data/IN/"
|
||||
|
||||
# Tweet-datafile output directory
|
||||
td = "data/tweets/"
|
||||
td = "data/OUT/"
|
||||
|
||||
# Name of file that all tweets will be written to
|
||||
file_alltweets = "ALL-SENATORS-TWEETS.csv"
|
||||
@@ -171,9 +174,9 @@ print("---")
|
||||
# read keywords from a file and write to list.
|
||||
keywords = []
|
||||
# Remove duplicate Keywords and save all non-duplicates to 'data/keywords.txt'
|
||||
deDupe("data/keywords-raw.txt", "data/keywords.txt")
|
||||
deDupe(f"{di}keywords-raw.txt", f"{di}keywords.txt")
|
||||
# Read the keywords from a file
|
||||
with open("data/keywords.txt", "r") as file:
|
||||
with open(f"{di}keywords.txt", "r") as file:
|
||||
lines = file.readlines()
|
||||
for line in lines:
|
||||
keyword = line.strip() # Remove the newline character
|
||||
|
||||
Reference in New Issue
Block a user