Counting occurrences of a character in a string
So, performance. Let's list off things that are commonly done wrong that you do in your code:


print statements in a loop
line-by-line parsing of input
mid-list removals of values (removeAll())
not enough functions


The performance can be significantly improved by doing batch operations on the input, processing, and output.

Additionally, the last point is important. Java compiles code essentially on a method-by-method basis. By keeping all your code in the main method you are reducing the possibility for Java to compile and optimize it.

Read the whole file in, split the lines out in one operation, write all the results out as one string.

That will likely remove more than half your execution time... but your actual algorithm is slow as well.

Since you use regular expressions to split the characters, you may as well use one to just clean up the whole URL... and strip all vowels that way.

Here's a scratch-up of what I would consider given this task. It shows the ideas I was mentioning, and also uses some Java 8 features:

public static void main(String[] args) throws IOException {
    for (String infile : args) {
        System.out.println(processSource(Paths.get(infile)));
    }
}

private static String processSource(Path path) throws IOException {
    List&lt;String&gt; alldata = Files.readAllLines(path);
    Iterator&lt;String&gt; it = alldata.iterator();
    final int size = Integer.parseInt(it.next());

    String[] results = new String[size];
    for (int cnt = 0; it.hasNext() &amp;&amp; cnt &lt; size; cnt++) {
        results[cnt] = computeRatio(it.next());
    }

    return String.join("\n", results);

}

private static final Pattern DISCARD = Pattern.compile("(^www\\.)|[aeiou]");

private static final String computeRatio(String url) {
    int limit = url.lastIndexOf('.');
    String clean = DISCARD.matcher(url.substring(0, limit)).replaceAll("");
    // include the URL for debug:
    // return String.format("%d/%d -&gt; %s", clean.length() + url.length() - limit, url.length(), url);

    // simple result
    return String.format("%d/%d", clean.length() + url.length() - limit, url.length());
}