Reverse each group of k elements in a list
The core of your solution doesn't suit my taste:


private static String reversedByK(String[] nums, int k) {
    StringBuilder result = new StringBuilder();
    for (int i = k - 1; i &lt; nums.length; i += k) {
        for (int j = i; i - j &lt;= k - 1; j--) {
            result.append(',').append(nums[j]);
        }
    }

    for (int i = nums.length - nums.length % k; i &lt; nums.length; i++) {
        result.append(',').append(nums[i]);
    }
    return result.substring(1);
}



My main gripe is that it works at two different levels: it accepts an array as input, but returns a string.  It's a mild violation of the Single Responsibility Principle.  One consequence is that it uses the assumption that a comma should be used as a delimiter.  It would be more elegant if whichever function performed .split(",") were also responsible for doing String.join(",", …).

Also consider taking advantage of the Scanner more to help you with parsing the input.

private static final Pattern DELIM = Pattern.compile(";|\n|\r");

public static void main(String[] args) {
    …
    try (Scanner file = new Scanner(new File(args[0])).useDelimiter(DELIM)) {
        while (file.hasNextLine()) {
            System.out.println(reversedByK(file.next(), file.nextInt()));
            file.nextLine();
        }
    } catch (FileNotFoundException fnfe) {
        System.err.println("Could not find file.");
    }
}

private static String reversedByK(String list, int k) {
    String[] array = list.split(",");
    reversedByK(array, k);
    return String.join(",", array);
}

private static void reversedByK(String[] array, int k) {
    for (int i = 0; i + k &lt;= array.length; i += k) {
        for (int a = i, b = i + (k - 1); a &lt; b; a++, b--) {
            String swap = array[a];
            array[a] = array[b];
            array[b] = swap;
        }
    }
}


One bonus benefit of this swap-in-place solution is that there is no need for a second loop in reversedByK() to handle the remaining elements.