Ejemplo n.º 1
0
 public static void main(String[] args) {
   FileSystem fs = new FileSystem();
   unique unq = new unique();
   String linesToBeDisplayed;
   try {
     String text = fs.readFileContent(args[0]);
     linesToBeDisplayed = unq.getUniqueLines(text);
     System.out.println(linesToBeDisplayed);
   } catch (Exception e) {
     System.err.println(e);
   }
 }
Ejemplo n.º 2
0
  public static void main(String[] args) {
    wc Wc = new wc();
    FileSystem fs = new FileSystem();
    try {
      String text = fs.readFileContent(args[0]);
      int lineCount = Wc.countLines(text);
      int wordCount = Wc.countWords(text);
      int charCount = Wc.countChar(text);

      System.out.println(lineCount + "\t" + wordCount + "\t" + charCount);
    } catch (Exception e) {
      System.err.println(e);
    }
  }