I have to create an input file with a string of numbers in it. I need my program to create an output file with only the prime numbers of my input file in it. I'm totally lost as to how to create a loop to check my input file for prime numbers and create an output file with only prime numbers in it.

```
import java.util.Scanner;
import java.io.*;

public class ClassWork5_3 
{

    public static void main(String[] args) throws IOException 
    {
        Scanner keyboard = new Scanner(System.in);
        System.out.println("Enter file name: ");
        String filename = keyboard.nextLine();
        PrintWriter pw = new PrintWriter("output.txt");

        File file = new File(filename);
        Scanner inputFile = new Scanner(file);
        int line = inputFile.nextInt();

       while(inputFile.hasNext())
       {
         isPrime(line);

       }

    }

    public static boolean isPrime(int num)
    {
        boolean status;
        for(int i = 2; i < num/2; i++)
        {
            if (num%i==0)
            {
             status = false;
            }

        }
        return true;
    }   
}

```