From 5110f5db998ec7243332a8bc3acd1b39bdbeae3a Mon Sep 17 00:00:00 2001 From: ctroller Date: Wed, 21 Mar 2018 12:21:03 +0100 Subject: [PATCH] Write to file instead of stdout --- readme.md | 6 ++++++ src/main/java/ch/christiantroller/rlfantasy/Main.java | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 3468e38..95048c1 100644 --- a/readme.md +++ b/readme.md @@ -20,6 +20,12 @@ file to `output.txt`, and do the same with the `template_participants.txt` Then simply add users to the `participants.txt` file (one per line), and optionally modify the `output.txt` file to your likings (use `{DATA}` as placeholder for the data). +**How to run** + +The jar file is executable, so simply double-click it. Alternatively, run `java -jar rlfantasy.jar` +in your command line. + +The app will output the result to a file named `rlfantasy.txt`. **Advanced: Building + Dependencies** diff --git a/src/main/java/ch/christiantroller/rlfantasy/Main.java b/src/main/java/ch/christiantroller/rlfantasy/Main.java index 2f2b5f9..f42c276 100644 --- a/src/main/java/ch/christiantroller/rlfantasy/Main.java +++ b/src/main/java/ch/christiantroller/rlfantasy/Main.java @@ -104,7 +104,7 @@ private static void prettyPrintStats(List stats) throws IOException { ++i; } - System.out.print(template.replace("{DATA}", output.toString())); + Files.write(Paths.get("rlfantasy.txt"), template.replace("{DATA}", output.toString()).getBytes()); } private static List getAllStats() throws IOException {