bufr/src/main/java/ucar/nc2/iosp/bufr/tables/NcepMnemonic.java
private static void readSubCategories(String fileIn, PrintStream out, String token) throws IOException {
    System.out.printf("%s%n", fileIn);
    try (FileInputStream in = new  FileInputStream(fileIn)) {
      BufferedReader dataIS = new BufferedReader(new InputStreamReader(in,
              CDM.utf8Charset));
      while (true) {
        String line = dataIS.readLine();
        if (line == null) break;
        int posb = line.indexOf("DISCONTINUED");
        if (posb > 0) continue;
        posb = line.indexOf("NO LONGER");
        if (posb > 0) continue;
        posb = line.indexOf("WAS REPLACED");
        if (posb > 0) continue;

        int pos = line.indexOf(token);
        if (pos < 0) continue;
        System.out.printf("%s%n", line);

        boolean is31 = token.equals("031-");
        String subline = is31 ? line.substring(pos) : line.substring(pos + token.length());
        //if (is31) System.out.printf(" '%s'%n", subline);

        int pos2 = subline.indexOf(' ');
        String catS = subline.substring(0, pos2);
        String desc = subline.substring(pos2 + 1);
        //System.out.printf("   cat='%s'%n", catS);
        //System.out.printf("  desc='%s'%n", desc);
        int cat = Integer.parseInt(catS.substring(0, 3));
        int subcat = Integer.parseInt(catS.substring(4, 7));
        desc = StringUtil2.remove(desc, '|').trim();
        //System.out.printf("  cat=%d subcat=%d%n", cat,subcat);
        //System.out.printf("  desc='%s'%n", desc);
        //System.out.printf("%d, %d, %s%n", cat, subcat, desc);
        out.printf("%d; %d; %s%n", cat, subcat, desc);
      }
    }


  }
private static void readSubCategories(String fileIn, PrintStream out, String token) throws IOException {
    System.out.printf("%s%n", fileIn);
    try (FileInputStream in = new  FileInputStream(fileIn)) {
      BufferedReader dataIS = new BufferedReader(new InputStreamReader(in,
              CDM.utf8Charset));
      while (true) {
        String line = dataIS.readLine();
        if (line == null) break;
        int posb = line.indexOf("DISCONTINUED");
        if (posb > 0) continue;
        posb = line.indexOf("NO LONGER");
        if (posb > 0) continue;
        posb = line.indexOf("WAS REPLACED");
        if (posb > 0) continue;

        int pos = line.indexOf(token);
        if (pos < 0) continue;
        System.out.printf("%s%n", line);

        boolean is31 = token.equals("031-");
        String subline = is31 ? line.substring(pos) : line.substring(pos + token.length());
        //if (is31) System.out.printf(" '%s'%n", subline);

        int pos2 = subline.indexOf(' ');
        String catS = subline.substring(0, pos2);
        String desc = subline.substring(pos2 + 1);
        //System.out.printf("   cat='%s'%n", catS);
        //System.out.printf("  desc='%s'%n", desc);
        int cat = Integer.parseInt(catS.substring(0, 3));
        int subcat = Integer.parseInt(catS.substring(4, 7));
        desc = StringUtil2.remove(desc, '|').trim();
        //System.out.printf("  cat=%d subcat=%d%n", cat,subcat);
        //System.out.printf("  desc='%s'%n", desc);
        //System.out.printf("%d, %d, %s%n", cat, subcat, desc);
        out.printf("%d; %d; %s%n", cat, subcat, desc);
      }
    }


  }
private static void readSubCategories ( String fileIn , PrintStream out , String token ) throws IOException { System . out . printf ( "%s%n" , fileIn ) ; try ( FileInputStream in = new FileInputStream ( fileIn ) ) { BufferedReader dataIS = new BufferedReader ( new InputStreamReader ( in , CDM . utf8Charset ) ) ; while ( true ) { String line = dataIS . readLine ( ) ; if ( line == null ) break ; int posb = line . indexOf ( "DISCONTINUED" ) ; if ( posb > 0 ) continue ; posb = line . indexOf ( "NO LONGER" ) ; if ( posb > 0 ) continue ; posb = line . indexOf ( "WAS REPLACED" ) ; if ( posb > 0 ) continue ; int pos = line . indexOf ( token ) ; if ( pos < 0 ) continue ; System . out . printf ( "%s%n" , line ) ; boolean is31 = token . equals ( "031-" ) ; String subline = is31 ? line . substring ( pos ) : line . substring ( pos + token . length ( ) ) ; //if (is31) System.out.printf(" '%s'%n", subline);
 int pos2 = subline . indexOf ( ' ' ) ; String catS = subline . substring ( 0 , pos2 ) ; String desc = subline . substring ( pos2 + 1 ) ; //System.out.printf("   cat='%s'%n", catS);
 //System.out.printf("  desc='%s'%n", desc);
 int cat = Integer . parseInt ( catS . substring ( 0 , 3 ) ) ; int subcat = Integer . parseInt ( catS . substring ( 4 , 7 ) ) ; desc = StringUtil2 . remove ( desc , ' ' ) . trim ( ) ; //System.out.printf("  cat=%d subcat=%d%n", cat,subcat);
 //System.out.printf("  desc='%s'%n", desc);
 //System.out.printf("%d, %d, %s%n", cat, subcat, desc);
 out . printf ( "%d; %d; %s%n" , cat , subcat , desc ) ; } } }
Read NCEP mnemonic BUFR tables.
Read NCEP mnemonic BUFR tables .