java - Using scanner to read string from text file and then print out -


I have a text file that has a string, - "! - ========= == All the objects in classes: FunctioningFrages: Detelad =========== " In this as you can see in the code below. If there is this string in the text file, then I need to read it from the text file and then print it again. The problem is that I can not do that work, why my code is not printing.

Any help would be appreciated thanks!

  public class Main {public static void main (String [] AGR) file throws Notfound Akspesheshn (File = new File ( "C: / Users / Anton / Pictures / 1 x Jiotronsform. 5m. cinematography "txt); Scanner scan = new Scanner (file); while (ScankhasNext ()) {string str = scan.next (); if (str =="! - ======= ==== all purposes in the classroom: Fasisreshnsfas: Diteelad =========== ") {System.out.print (str);}} scan.close ();}}  < / pre>  

use under

code, to use a word to read just before the scanner. The whole line ..

  Scanner scan = new Scanner (file); string str1 = scan.nextLine (); if (str1.equals ( "! - all objectives =========== class: Fasisreshnsfas: Diteyld ========= == ")) System.out.println (str1); scan.close ();    

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -