Hey all I'm fairly new to this but I want to not hardcode a file to be read in but I want to read it in from the terminal/command prompt. Here is what I have so far, I'm hardcoding the filename in bufferedWriter but how can I make it to where I can do a command such as (java main < in.txt > out.txt). Thanks in advance.

```
public static void main(String[] args) {

    String inFile = "in.txt";
    String outFile = "out.txt";

    if (args.length > 1) {
        inFile = args[0];
        outFile = args[1];
    }

    Lexer lexer = new Lexer(inFile);

    try {
        BufferedWriter writer = new BufferedWriter(new FileWriter(outFile));

        Token t;

        while ((t = lexer.nextToken()) != null) {
            writer.write(t.toString());
            writer.newLine();
        }

        writer.close(); 

        System.out.println("Done tokenizing file: " + inFile);
        System.out.println("Output written in file: " + outFile);
    } catch (IOException e) {
        e.printStackTrace();
  }
}

```