Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- *
- * @author jahkeyshagodwin
- */
- import java.io.*;
- import java.util.*;
- public class JavaFile {
- /**
- * @param args the command line arguments
- * @throws java.io.FileNotFoundException
- */
- public static void main(String[] args) throws FileNotFoundException{
- Scanner scan = new Scanner(System.in);
- System.out.print("what is the file name?");
- String name = scan.nextLine();
- Scanner input = new Scanner (new File (name));
- // initialize the string delimiter
- scan.useDelimiter(";");
- // Printing the tokenized Strings
- while(scan.hasNext()){
- System.out.println(scan.next());
- }
- // closing the scanner stream
- scan.close();
- }
Add Comment
Please, Sign In to add comment