The way you asked your question, you are not interested in the source code line where the exception occurred (this would be part of the stack trace as the commenter to your question has indicated). Instead, you are reading a text file line by line and you are checking each line against your condition and you want to know the line where it occurred, right?
If so, you are showing too little of your code. I guess you have a loop somewhere where you read a line and then do the check and possibly other things.
The way to go would be to introduce a counter (int counter = 0;
outside your loop and increase it (counter++
) for each line you read. Then you can add this information to your Exception message: throw new Exception("This condition has not been met at line:" + counter)