shreyaa1998 opened a new issue, #5767:
URL: https://github.com/apache/jmeter/issues/5767

   ### Expected behavior
   
   Response message:org.apache.jorphan.util.JMeterException: Error invoking bsh 
method: eval    Sourced file: inline evaluation of: ``BufferedReader fileReader 
= new BufferedReader (new fileReader(vars.get("path")) . . . '' : Typed 
variable declaration : Unknown class: fileReader
   
   Getting an error "Unknown class: fileReader" while trying to read a .txt 
file. Do we have a workaround? I am searching a method to read a specific line 
from a .txt text file and display that specific line in Jmeter console.
   
   I used the below code, to read the 4th line:
   
   BufferedReader fileReader = new BufferedReader (new 
fileReader(vars.get("path")));
   int counter=4;
   content = fileReader.readLine();
   while ((nextLine = fileReader.readLine())!=null)
   {
        content = content + "\n" + nextLine;
        counter++;
   }
   vars.put("content",content);
   
   x=vars.get("content")
   
   ### Actual behavior
   
   _No response_
   
   ### Steps to reproduce the problem
   
   Using a notepad and saving it .txt extension
   
   ### JMeter Version
   
   5.3
   
   ### Java Version
   
   _No response_
   
   ### OS Version
   
   _No response_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@jmeter.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to