Hello community.
I want to search in a text file for a Keyword to readout what is in the same line after the keyword.
Keyword and the contend i look for are seperated with a vertical dash "|"
Like this:
Source:
wordone|blaone
wordtwo|blatwo
wordthree|blathree
wordfour|blafour
...
Keyword is "wordfour"
read out result:
blafour
currently I have this code:
thanks for answering
I want to search in a text file for a Keyword to readout what is in the same line after the keyword.
Keyword and the contend i look for are seperated with a vertical dash "|"
Like this:
Source:
wordone|blaone
wordtwo|blatwo
wordthree|blathree
wordfour|blafour
...
Keyword is "wordfour"
read out result:
blafour
currently I have this code:
fo = open(filename, "rt") #print ("Name of the file:\n", fo.name, '\n') line = fo.readlines() print ("Read Line: \n %s" %(line))_____________________________________________________________
thanks for answering