Guest User

Untitled

a guest
Apr 21st, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. /**
  2. *
  3. * @author jahkeyshagodwin
  4. */
  5. import java.io.*;
  6. import java.util.*;
  7. public class JavaFile {
  8.  
  9. /**
  10. * @param args the command line arguments
  11. * @throws java.io.FileNotFoundException
  12. */
  13. public static void main(String[] args) throws FileNotFoundException{
  14. Scanner scan = new Scanner(System.in);
  15. System.out.print("what is the file name?");
  16. String name = scan.nextLine();
  17. Scanner input = new Scanner (new File (name));
  18. // initialize the string delimiter
  19. scan.useDelimiter(";");
  20. // Printing the tokenized Strings
  21. while(scan.hasNext()){
  22. System.out.println(scan.next());
  23. }
  24. // closing the scanner stream
  25. scan.close();
  26. }
Add Comment
Please, Sign In to add comment