changes folder structure of in- and output files

This commit is contained in:
Michael Beck
2023-06-23 20:39:40 +02:00
parent 02c3d055bd
commit 27746cd886
5 changed files with 6 additions and 167 deletions

View File

@@ -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