Umm if you mean there are only words that consist of either a, b or both of them, and you want to print lines with only 'a's (which means: you don't want to print lines that have 'b's in them)? In that case:
Actually I'm not sure if "b" or "file.txt" comes first; I always forget it. Well, try and see
EDIT: the above works if there's one word per one line. If there are multiple, it will not work.